time-limit-promise
Fulfill long runinng promises on timeout.
Unlike other implementations on npm it has some nice extra features:
- You can both reject and resolve promises on timeout
- You can provide custom value with which promise will be rejected or resolved on timeout
- Unrefs promise timer, so it will not block your app from exit.
- Uses
Promise
implementation of the passed promise: no external implementation dependencies, no globalPromise
dependencies
Install
npm install time-limit-promise
Usage
const timeLimit = ;const fetch = ; var fetchPromise = ; ; ; ;