with-retry

1.0.1 • Public • Published

with-retry

Retry an async action

Usage

const fetchSite = superagent('https://www.github.com');
const fetchSiteWithRetry = withRetry(fetchSite);
 
const fetchSiteWithRetryWithOptions = withRetry(fetchSite, 5, {
  shouldRetry: error => error.name === 'TimeoutError',
  maxRetries: 5,
  getDelayForRetry: n => 1000 * n,
});

Author

Andreas Brekken andreas@brekken.com

Readme

Keywords

none

Package Sidebar

Install

npm i with-retry

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • abrkn