0.1.1 • Published 7 years ago
@beyonk/promise-retry v0.1.1
Promise Retry
Retryable promise utility for the browser
Why
There are a few similar modules out there, mostly abandonware, few with tests.
Usage
Install the module:
npm install --save-dev @beyonk/promise-retryUse it in your code:
// defaults
const retries = 5
const intervalBetweenRetries = 1000
const myFunction = async function () { ...blah }
retry(
  myFunction,
  retries,
  intervalBetweenRetries
)Running Tests
npm testCredits
- Code adapted from this gist, and corrected.