How to use fetch-retry - 4 common examples

To help you get started, we’ve selected a few fetch-retry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vinniejames / coinfox / src / SupportedCoins.js View on Github external
componentWillMount () {

    console.log('hi im here');

    fetch('https://www.cryptonator.com/api/currencies')
      .then(function(res) {
        if (!res.ok) {
          throw Error(res.statusText);
        }
        return res;
      })
      .then((res) => res.json())
      .then((res)=> {
          // https://stackoverflow.com/a/40969739/1580610
            this.setState({supported: res.rows});
        }
      )

  }
github vinniejames / coinfox / src / Components / AddCoin.js View on Github external
componentWillMount () {

    fetch('https://www.cryptonator.com/api/currencies')
      .then(function(res) {
        if (!res.ok) {
          throw Error(res.statusText);
        }
        return res;
      })
      .then((res) => res.json())
      .then((res)=> {
          // https://stackoverflow.com/a/40969739/1580610
          if (this.refs.addRef) {
            this.setState({options: res.rows});
          }
        }
      )
  }
  handleTickerChange = (selected_ticker) => {
github adrianonrails / manga-downloader / app / src / main / js / services / manga-services.js View on Github external
const getPages = async location => {
  const pages = await fetch(`${SERVER_URL}/page/${location}`, RETRY_OPTIONS);
  return await pages.json();
};
github JMPerez / spotify-dedup / app / scripts / fetch.js View on Github external
export default (url, options) =>
  fetchRetry(url, options)
    .then(response => {
      return log(response);
    })
    .catch(response => {
      return log(response);
    });

fetch-retry

Extend any fetch library with retry functionality

MIT
Latest version published 8 months ago

Package Health Score

77 / 100
Full package analysis

Popular fetch-retry functions