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.
- Host: GitHub
- URL: https://github.com/chrisyip/stated-promise
- Owner: chrisyip
- Created: 2022-08-25T09:04:42.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-29T06:54:46.000Z (almost 4 years ago)
- Last Synced: 2025-05-14T22:12:18.545Z (about 1 year ago)
- Language: TypeScript
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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(...)
}
```