1.0.0 • Published 5 years ago

@bitbar/deferred-promise v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

Deferred Promise

Simple jQuery Deferred() port using native Promise.

Install

npm install --save @bitbar/deferred-promise

Use

const DeferredPromise = require('@bitbar/deferred-promise');

const first = new DeferredPromise();
const second = new DeferredPromise();

first.then( () => console.log('O, hello!') );
second.then( () => console.log('Yupi!') );

Promise.all([ first, second ]).then( () => console.log('Ow yeah!') );

setTimeout(first.resolve, 1000);
second.resolve();

License

This project is using ISC license.