0.7.0 • Published 3 years ago

@huudan/retry-promise-util v0.7.0

Weekly downloads
275
License
MIT
Repository
github
Last release
3 years ago

@huudan/retry-promise-util

Retries a function returning a promise with a delay between each retry

Usage

import { retryPromise } from '@huudan/retry-promise-util';

retryPromise(() => fetch('https://api.example.com'), {
  delay: 2000, // Milliseconds between each retry
  multiplier: 2, // Multiplier for delay (ex: 2000, 4000, 8000...)
  retries: 3 // Number of retries after the promise is rejected
}).then((response) => response.json())
  .then(console.log)
  .catch(console.error);
0.7.0

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago