Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/lqqyt2423/retry-if-err

promise 函数重试
https://github.com/lqqyt2423/retry-if-err

Last synced: 2 days ago
JSON representation

promise 函数重试

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()
```