1.0.0 • Published 3 years ago

stated-promise v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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(...)
}