Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lqqyt2423/retry-if-err
promise 函数重试
https://github.com/lqqyt2423/retry-if-err
Last synced: 2 days ago
JSON representation
promise 函数重试
- Host: GitHub
- URL: https://github.com/lqqyt2423/retry-if-err
- Owner: lqqyt2423
- Created: 2017-12-22T07:54:25.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-22T08:03:13.000Z (about 7 years ago)
- Last Synced: 2024-04-25T20:03:58.577Z (8 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# retry-if-err
执行`promise` 函数,如碰到错误,进行重试。`then` 和`catch` 返回的参数保持与原函数`fn` 一致。
### install
```
npm install retry-if-err --save
```### usage
```javascript
const retryIfErr = require('retry-if-err')
retryIfErr(fn, tryCount, tryInterval, ...params).then().catch()
```