Added hydrate and dehydrate options to the persistQueryClient function#2131
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tannerlinsley/react-query/Cv3ytrtxpN1bNpMzKuTLn6pvDRqr |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 59c2bb4:
|
|
Was just about to come and add this exact PR! We're running in prod with our own modified persistQueryClient at the moment would be great to see this merged. |
|
🎉 This PR is included in version 3.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The reason to add this is to be able to customize the hydrate/dehydrate behaviour on the persistQueryClient. For instance, I don't want a network error to remove a cache entry from my persisted state, I want the client cache to be equivalent to the persisted cache at all time, with dehydrate options, I can achieve this behaviour.