Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Latest commit

 

History

History
31 lines (19 loc) · 572 Bytes

README.md

File metadata and controls

31 lines (19 loc) · 572 Bytes

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.