@nthlytics/observable-promise
v1.0.1
Published
A function that takes an executor and wraps it in a Promise with observable state.
Downloads
4
Readme
observable-promises
A function that takes an executor and wraps it in a Promise with observable state.
Usage
const executor = (resolve, reject) => {
resolve('I win');
};
const p = new ObservablePromise(executor);
await p;
Properties
An ObservablePromise has the following properties:
- isResolved: false until the promise resolves
- isRejected: false until the promise rejects
- isPending: true until the promise resolves or rejects