createWebStoragePersistor on React-Query v3
Hi everyone, I was wondering if i could get some help regarding using WebStorage Persitance in React query v3.
The idea is we have multiple modules in using RQ, but i want to only persist in cache a subset of calls starting with the following key .
How could i do this ?
8 Replies
multiple-amethyst•3y ago
persister accepts
dehydrateOptions, which allows to filter queries that should be storedcorrect-apricotOP•3y ago
COuld you maybe help me write that code down ?
multiple-amethyst•3y ago
let's do the following please: consult the docs and the typescript types, and then post the code you have and I'll see if it checks out
correct-apricotOP•3y ago
Sure thing !
correct-apricotOP•3y ago
How about like this ?

correct-apricotOP•3y ago
Or is it better with the Hash Startwith

multiple-amethyst•3y ago
yeah you can do both. does it work?
just fyi, the persisters got a lot better in v4 😅
correct-apricotOP•3y ago
I know, I am stuck with v3 on this project unfortunately... Thanks for the help though 🙂
I will test now
It works !
Thanks 🙂