UNPKG

@aspectus/progress-promise-proxy

Version:

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

23 lines (17 loc) 514 B
/*! * progress-promise-proxy v0.10.2 * (c) 2020 Alex Tkachenko * Released under the MIT License. */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var promiseProxy = require('@aspectus/promise-proxy'); 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;