-
-
Notifications
You must be signed in to change notification settings - Fork 528
feat(openapi-react-query): Pass abort signal to fetch #1864
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
Conversation
🦋 Changeset detectedLatest commit: 0778893 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean update and great test! 👌
Might be a stupid question but should it be aswell added to other useSuspenseQuery
and useMutation
? @zsugabubus
@kerwanp As far as I know mutations cannot be cancelled, |
This is great to prevent memory leaks, but is there a way to circumvent this behavior in case you want the fetch to continue even if the component has been unmounted? |
My first thought was that this kind of stuff should be configured via Tanstack Query but I couldn't find such setting. So you have to build your own But are you 100% sure you want to go down this road? Maybe |
Thanks for the quick reply! Some background to why I am asking: I am currently migrating to this library, and the old behaviour was to fire and forget a fetch call. This fetch call is very expensive and not cancellable, so it locked down the API until it finished (but of course, no one took the answer). This happened because of a route change so the component unmounted. It was also not cached, so overall not good. It can definitely be solved using the options you provided, or using the fetchClient, but I wish maybe an override of this feature was available in the options :) |
Changes
See changeset.
How to Review
How can a reviewer review your changes? What should be kept in mind for this review?
Checklist
docs/
updated (if necessary)