-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RTQ: How to unsubscribe from a useLazyQuery
#2055
Comments
Hi, const [trigger, { data, unsubscribe }] = useLazyEnpointQuery(); |
At the moment, the only way to unsubscribe from a lazy query is to start a new one with a different argument or to unmount the component. It might be a nice to have to have an unsubscribe option, but it's not high in the priorities. PRs against |
I think the feature is added. |
I think the reset would be more important like @phryneas mentions here #2133 (comment) I hope this reset feature will gain priority |
Hello 👋
In documentation https://redux-toolkit.js.org/rtk-query/usage/usage-without-react-hooks#removing-a-subscription
is specified a different way of subscription - un-subscription method for a
query
, but how to we do it with a hook ?I cant pass a
skip
property touseLazyQuery
that forces the unsubscription from the query, it can be used only with theuseQuery
hook. So how can I unsubscribe from a lazy query ?Thanks for help!
The text was updated successfully, but these errors were encountered: