Is there a global event listener for invalidateQueries in TanStack Query? #7798
-
Hi TanStack Query team, I'm currently using TanStack Query in my project and I have a question regarding the invalidateQueries function. Specifically, I would like to know if there is a global event listener or hook that triggers when the invalidateQueries function is fired. Context: Question: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
no, there is not. I'd make a wrapper around |
Beta Was this translation helpful? Give feedback.
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