UNPKG

@aspectus/progress-promise-proxy

Version:

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

19 lines (15 loc) 419 B
/*! * progress-promise-proxy v0.10.2 * (c) 2020 Alex Tkachenko * Released under the MIT License. */ import { createProxy } from '@aspectus/promise-proxy'; var main = createProxy({ progress: function progress(callback) { if (this.$data.progressEmitter && this.$data.progressEmitter.on) { return this.$data.progressEmitter.on('progress', callback); } return this; } }); export default main;