Replies: 1 comment
-
don't worry, i missed that you can specify which query client to use within useQuery (it defaults to the closest context). This is perfect. You guys really do think of everything!! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi brains trust,
I have looked through the documentation related to
@tanstack/query-sync-storage-persister
and@tanstack/react-query-persist-client
, but couldn't find an answer to this use case. I need to persist data from a few select queries (e.g. global search history) within local storage, but the majority of the other queries i do not want to store - i want them just in memory, i.e. default cache behaviour.Is it possible to do this? I wasn't sure if i needed to instantiate multiple QueryClient's, but then, how would useQuery know which one to use? Ideally, i would lke to be able to pass an optional prop into useQuery that then triggered the local storage dehydration of the data.
Any advice would be greatly appreciated. Thanks
Beta Was this translation helpful? Give feedback.
All reactions