An open API service indexing awesome lists of open source software.

https://github.com/chrisyip/stated-promise

StatedPromise provides a couple of methods for querying Promise state.
https://github.com/chrisyip/stated-promise

Last synced: about 1 year ago
JSON representation

StatedPromise provides a couple of methods for querying Promise state.

Awesome Lists containing this project

README

          

# StatedPromsie

StatedPromise provides a couple of methods for querying Promise state.

## Installation

```shell
npm i stated-promise
```

## Usage

```typesript
import { StatedPromise } from 'stated-promise'

const statedPromise = new StatedPromise(Promise.resolve(...))

if (statedPromise.isPending()) {
// wait
} else {
// promise fulfilled
statedPromise.getPromise().then(...)
}
```