Skip to content

Is there a global event listener for invalidateQueries in TanStack Query? #7798

Answered by TkDodo
ezalorsara asked this question in Q&A
Discussion options

You must be logged in to vote

no, there is not. I'd make a wrapper around queryClient.invalidateQuries that also does whatever you want to do. But this imperative approach is not something that we have internally. For a query, it doesn't matter what triggered it. An invalidation also doesn't necessarily mean that the queryFn is running

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ezalorsara
Comment options

Answer selected by ezalorsara
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants