Uh oh!
There was an error while loading. Please reload this page.
feat: retry callback - #359
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
enkot
commented
Mar 7, 2024
@pi0 Could you please check? I think it's a really flexible solution. |
cernymatej
commented
Jun 3, 2024
I love this idea. Probably link my issue as well as this should cover that use case too: #355 |
AryanShrivastava18
commented
Nov 26, 2024
@enkot By when can we expect this change to be the part of the release? Is there anything I can give a support for to push it to release? |
lacherogwu
commented
May 1, 2025
retryCount will be essential 🙏 |
fredericDelaporte
commented
May 7, 2025
The PR does not add a new option. It alters an existing one which currently can only be @enkot, thanks for the PR, I too would need this feature. I hope it can get merged. It would likely help if you could resolve the conflicts it has with current code. But maybe it will not entirely cover my use case: an API that may return 401 on Bearer authentication with an access token, and having an endpoint taking refresh tokens for renewing the authentication. With your callback, I could attempt to renew the token |
🔗 Linked issue
resolves#358
resolves#355 (updated)
❓ Type of change
📚 Description
This PR adds support for a callback for
retryoption, which is a function that takes a fetch context object and count of retries and returns a boolean (trueif the request needs to be retried):It runs onError and after a response, so the developer can decide when the request needs to be retried.
📝 Checklist