@dkx/retry-promise
v1.0.0
Published
Retry promise
Downloads
3
Readme
DKX/RetryPromise
Retry promise
Installation
$ npm install --save @dkx/retry-promise
or with yarn
$ yarn add @dkx/retry-promise
Usage
import {retryPromise} from '@dkx/retry-promise';
(async () => {
await retryPromise(async () => {
await doSomething();
}, {
retries: 10,
delay: 100,
exponential: false,
shouldRetry: (times) => {
return findOutIfOperationShouldRetry(times); // return boolean
},
});
})();
All options are optional.