The retry function can be used to run logic after every failed attempt (e.g. logging a message, assessing the last error, etc.). It is called with the last error and the upcoming attempt number. Returning will retry the function as long as the has not been exceeded. Returning will end the execution.
true
numOfAttempts
false
Default value is a function that always returns true.
startingDelay?: number
The delay, in milliseconds, before executing the function for the first time.
Default value is 100 ms.
timeMultiple?: number
The startingDelay is multiplied by the timeMultiple to increase the delay between reattempts.