Skip to content
This repository was archived by the owner on Jul 9, 2024. It is now read-only.
/ deferred-promise Public archive

Simple port of jQuery Deffered() based on native Promise

License

Notifications You must be signed in to change notification settings

bitbar/deferred-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Marek Sierociński
Sep 2, 2019
5db7b94 · Sep 2, 2019

History

2 Commits
Sep 2, 2019
Sep 2, 2019
Sep 2, 2019
Sep 2, 2019
Sep 2, 2019
Sep 2, 2019
Sep 2, 2019

Repository files navigation

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.