Is lazy evaluation possible for a query key #6751
Answered
by
TkDodo
vmichailidisdev
asked this question in
Q&A
-
Hello, The only way I can think is: fetch(url).then(data => queryClient.setQueryData(createKeyFrom(data), data)) Is there any cleaner way of doing this? (I don't mind having the same data under 2 query keys.) |
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Jan 23, 2024
Replies: 1 comment 5 replies
-
how is that possible? The key is the dependency to the fetch ... |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sure, you can do
queryClient.getQueryCache().subscribe
and listen to all events that come in and do with those what you like. That's also what the devtools do :)