async-retry
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -40,7 +40,3 @@ 'use strict'; | ||
if (val instanceof Promise) { | ||
val.then(resolve, onError); | ||
} else { | ||
resolve(val); | ||
} | ||
Promise.resolve(val).then(resolve, onError); | ||
}); | ||
@@ -47,0 +43,0 @@ }); |
{ | ||
"name": "async-retry", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Retrying made simple, easy and async", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index", |
@@ -12,4 +12,5 @@ # async-retry | ||
```js | ||
import retry from 'async-retry' | ||
import fetch from 'node-fetch' | ||
// Packages | ||
const retry = require('async-retry') | ||
const fetch = require('node-fetch') | ||
@@ -39,3 +40,2 @@ await retry(async bail => { | ||
- Exported as `default`. Use `import retry from 'async-retry'` (ES6) or `require('async-retry').default` (legacy). | ||
- The supplied function can be `async` or not. In other words, it can be a function that returns a `Promise` or a value. | ||
@@ -42,0 +42,0 @@ - The supplied function receives two parameters |
4937
35