1.0.0 • Published 2 years ago
flaired v1.0.0
flaired
The flaired package is a small set of tools for working with JavaScript Promises. It allows you to resolve and reject promises outside of their functions.
Importing
const Flaired = require('flaired');
... or in TypeScript:
import Flaired from 'flaired';
Usage
let promise = new Flaired();
promise.then(console.log('hello!')); // prints nothing
await Flaired.wait(1000); // waits for 1 second, nothing has been printed yet
promise.resolve(); // <-- prints 'hello!' here
1.0.0
2 years ago