1.0.1 • Published 6 years ago
@nthlytics/observable-promise v1.0.1
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