The callback that is periodically invoked.
The number of milliseconds between the settlement of the last promise returned by the callback and the next invocation. Or a callback that receives the latest result and returns the delay. If omitted then delay is 0.
The callback that should return true
to terminate the loop, or false
to proceed to the next
iteration. The condition is checked before the next iteration is scheduled. If omitted then loop is repeated
indefinitely.
The promise that is fulfilled with the callback result.
Invokes a callback periodically with the given delay between fulfillment of returned promises until the condition is met. If callback throws an error or returns a rejected promise, then the promise returned from repeat is rejected.
The callback that is periodically invoked.
Optional
ms: number | ((value, index) => number)The number of milliseconds between the settlement of the last promise returned by the callback and the next invocation. Or a callback that receives the latest result and returns the delay. If omitted then delay is 0.
Optional
until: ((value, index) => unknown)The callback that should return truthy value to terminate the loop, or falsy to proceed to the next iteration. The condition is checked before the next iteration is scheduled. If omitted then loop is repeated indefinitely.
The promise that is fulfilled with the callback result.
Invokes a callback periodically with the given delay between fulfillment of returned promises until the condition is met. If callback throws an error or returns a rejected promise, then the promise returned from repeat is rejected.