Callback that will get executed before retrying the request. If this function returns an object having url and/or options properties, they will override existing values in the retried request.
(default: null)
retryOnNetworkErrorboolean
If true, will retry the request if a network error was thrown. Will also provide an 'error' argument to the onRetry and until methods.
Retry middleware
Retries a request multiple times in case of an error (or until a custom condition is true).
Options
milliseconds
(delay, nbOfAttempts) => milliseconds
number
(response, error) => boolean || Promise<boolean>
({ response, error, url, options }) => { url?, options? } || Promise<{url?, options?}>
boolean