owp.progress-promise
v1.0.3
Published
Promise with support for progress updates
Downloads
2
Maintainers
Readme
OpenWebProject progress-promise
Promise with support for progress updates
Installation
npm install owp.progress-promise --save
Usage
new ProgressPromise(function(resolve, reject, progress) { }) => Promise
const ProgressPromise = require("owp.progress-promise");
const promise = new ProgressPromise((resolve, reject, progress) => {
progress("Running...");
setTimeout(() => {
resolve("Done");
}, 1000);
});
promise.progress(progress => {
console.log("Progress: " + progress);
})
.then(response => {
console.log("Response: " + response);
});