1.0.1 • Published 7 years ago

window-fetch-retry v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

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);
  });
1.0.1

7 years ago

1.0.0

7 years ago