1.0.1 • Published 7 years ago
window-fetch-retry v1.0.1
window-fetch-retry
Adds retry functionality to window.fetch polyfill (whatwg-fetch).
- Retry count
- Retry delay
- Timeout (total of retries)
Requirements
ECMAScript 2015
Installation
$ npm install window-fetch-retry --save
Usage
import fetch from 'window-fetch-retry';
fetch('/users.json', {
retries: 3,
retryDelay: 1000,
timeout: 3000,
})
.then(res => res.json())
.then((json) => {
console.log('parsed json', json);
}).catch((ex) => {
console.log('parsing failed', ex);
});