The callback that must return the fulfilled result.
Optional
ms: number | ((error, index) => number)The number of milliseconds between the rejection of the last promise returned by the callback and the next invocation. Or a callback that receives the latest error and returns the delay. If omitted then delay is 0.
Optional
maxCount: numberThe maximum number of retries after which the last rejection reason is thrown.
The promise that is fulfilled with the callback result.
Invokes a callback periodically until it successfully returns the result. If a callback throws an error or returns a promise that is rejected then it is invoked again after a delay.