-
Notifications
You must be signed in to change notification settings - Fork 151
feat: retry callback #359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: retry callback #359
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
@pi0 Could you please check? I think it's a really flexible solution. |
|
I love this idea. Probably link my issue as well as this should cover that use case too: #355 |
|
@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? |
|
retryCount will be essential π |
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