Function: retry()
retry<
T
>(cb
: () =>Awaitable
<T
>,retries
:number
):Promise
<T
>
Asynchronously calls the callback function until it either succeeds or it runs out of retries. For a synchronous variant, see retrySync.
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
cb | () => Awaitable <T > | The function to be retried is passed in as a callback function. |
retries | number | The number of retries is also passed in as a parameter. Minimum of 0. |
Returns
Promise
<T
>
The result of the callback function is returned.