Simple jQuery Deferred()
port using native Promise
.
npm install --save @bitbar/deferred-promise
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();
This project is using ISC license.