UNPKG

@aspectus/progress-promise-proxy

Version:

Simple Promise proxy that adds `.progress` handler registry to promise object.

27 lines (21 loc) 877 B
/*! * progress-promise-proxy v0.10.2 * (c) 2020 Alex Tkachenko * Released under the MIT License. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@aspectus/promise-proxy')) : typeof define === 'function' && define.amd ? define(['exports', '@aspectus/promise-proxy'], factory) : (global = global || self, factory(global.ProgressPromiseProxy = {}, global.promiseProxy)); }(this, (function (exports, promiseProxy) { 'use strict'; var main = promiseProxy.createProxy({ progress: function progress(callback) { if (this.$data.progressEmitter && this.$data.progressEmitter.on) { return this.$data.progressEmitter.on('progress', callback); } return this; } }); exports.default = main; Object.defineProperty(exports, '__esModule', { value: true }); })));