Is it possible to filter queries with "refetching : true" while using "useIsFetching" or "useIsMutating" hooks? #2176
Answered
by
TkDodo
mojjominion
asked this question in
Q&A
-
Currently I'm using them as below
What I'd like to have is queries which have cache present and are being refeched
|
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Apr 22, 2021
Replies: 1 comment 1 reply
-
What might works is using the
or you could filter down to queries that are in the
because only a query that is successful can be re-fetched |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mojjominion
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fetching: true
doesn't really make much sense on these hooks, because it will give you the number of hooks that are currently fetching 🙃 .What might works is using the
predicate
function to filter down to only queries that already have data, something like:or you could filter down to queries that are in the
success
state:because only a query that is successful can be re-fetched