Function: retrySync()
retrySync<
T
>(cb
: () =>T
,retries
:number
):T
Synchronously calls the callback function until it either succeeds or it runs out of retries. For an asynchronous variant, see retry.
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
cb | () => 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
T
The result of the callback function is returned.