@3xpo/resolvablepromise
v0.2.11
Published
Promises which can be resolved from their object
Downloads
48
Readme
@3xpo/resolvablepromise
Promises which can be resolved from their object
Example Usage
import ResovlablePromise from '@3xpo/resolvablepromise';
const p = new ResolvablePromise();
setTimeout(() => p.resolve('World'), 100);
const p2 = new ResolvablePromise();
setTimeout(() => p.resolve('How are you?'), 200);
(async () => {
console.log('Hello,');
console.log(`${await p}!`);
await p2;
console.log(p2.value);
})();