1.0.0 • Published 2 years ago
stated-promise v1.0.0
StatedPromsie
StatedPromise provides a couple of methods for querying Promise state.
Installation
npm i stated-promise
Usage
import { StatedPromise } from 'stated-promise'
const statedPromise = new StatedPromise(Promise.resolve(...))
if (statedPromise.isPending()) {
// wait
} else {
// promise fulfilled
statedPromise.getPromise().then(...)
}
1.0.0
2 years ago