-
I'm looking for a way to know whether a query (identified by Here's my use-case: I have a service worker that sometimes receive fresh data for some endpoints will then I've looked at
So I guess that would be a 3rd state that doesn't exist yet:
Is there any other way to obtain this information? I'm not sure it really matters for this question, but for context, here's the relevant piece of code where i'm having this need: https://github.com/Sheraff/soft-serve-tunes/blob/bf8d7670287220ed852bae1ed2dae15b9512656f/src/components/WatcherSocket/index.tsx#L48-L61 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I actually found my answer by reading some unrelated questions. const state = queryClient.getQueryState([queryKey, queryParams], { type: "inactive" }) The query filters allow for matching only Now as a bonus for my next step: would anyone know whether it would be possible to somehow subscribe to "callback whenever this query becomes inactive"? |
Beta Was this translation helpful? Give feedback.
I actually found my answer by reading some unrelated questions.
The query filters allow for matching only
inactive
queries, which is exactly what I needed.Now as a bonus for my next step: would anyone know whether it would be possible to somehow subscribe to "callback whenever this query becomes inactive"?