fetch-retry
Advanced tools
Comparing version 3.2.3 to 4.0.0
'use strict'; | ||
require('es6-promise').polyfill(); | ||
@@ -4,0 +3,0 @@ module.exports = function (fetch, defaults) { |
{ | ||
"name": "fetch-retry", | ||
"version": "3.2.3", | ||
"version": "4.0.0", | ||
"description": "Extend any fetch library with retry functionality", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/jonbern/fetch-retry.git", |
@@ -7,3 +7,3 @@ # fetch-retry | ||
[![Build Status](https://travis-ci.org/jonbern/fetch-retry.svg)](https://travis-ci.org/jonbern/fetch-retry) | ||
[![Build Status](https://travis-ci.org/jonbern/fetch-retry.svg?branch=master)](https://travis-ci.org/jonbern/fetch-retry) | ||
@@ -22,2 +22,4 @@ ## npm package | ||
```javascript | ||
require('es6-promise').polyfill(); | ||
var originalFetch = require('isomorphic-fetch'); | ||
@@ -51,2 +53,5 @@ var fetch = require('fetch-retry')(originalFetch); | ||
> `fetch-retry` uses promises and requires you to polyfill the Promise API in order to support Internet Explorer. | ||
## Example: Exponential backoff | ||
@@ -53,0 +58,0 @@ The default behavior of `fetch-retry` is to wait a fixed amount of time between attempts, but it is also possible to customize this by passing a function as the `retryDelay` option. The function is supplied three arguments: `attempt` (starting at 0), `error` (in case of a network error), and `response`. It must return a number indicating the delay. |
@@ -5,3 +5,2 @@ 'use strict'; | ||
var expect = require('expectations'); | ||
var Promise = require('es6-promise'); | ||
@@ -986,2 +985,3 @@ describe('fetchBuilder', function () { | ||
var resolve, reject; | ||
// eslint-disable-next-line no-undef | ||
var promise = new Promise(function () { | ||
@@ -988,0 +988,0 @@ resolve = arguments[0]; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40461
105
1020