softonic / axios-retry

Axios plugin that intercepts failed requests and retries them whenever possible
Other
1.9k stars 167 forks source link

Feature request: Handle async onRetry function #236

Closed netanelep closed 1 year ago

netanelep commented 1 year ago

Hi,

Can you add support for async onRetry functions? Can I make a PR to make that happen?

One use case example is to refresh a token on 401

matthewborgman commented 1 year ago

@netanelep, per the docs, onRetry is "A callback to notify when a retry is about to occur. Useful for tracing." and so async support isn't necessary.

retryCondition, however, does support async and it's been used to support logic like refreshing a token.

mindhells commented 1 year ago

this is added in 3.8.1