OptionalattemptsHow many times to call the function in total, including the first. Defaults to 3.
OptionaldelayHow long to wait before the first retry, in milliseconds. Defaults to 1000.
OptionalfactorWhat to multiply the wait by after each retry. Defaults to 2: with the default delay, waits of 1s, 2s, 4s... Use 1 for a fixed delay.
OptionalshouldDecides whether an error is worth retrying, such as a network failure but not a 404. Defaults to retrying every error.
OptionalsignalStops retrying when aborted: retry rejects with the signal's reason, and doesn't start
another attempt. To also cancel the attempt in progress, pass the same signal to the
work itself, such as fetch.
Options for retry.