1.0.0 • Published 2 years ago

stated-promise v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 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(...)
}