You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
migrate Offline challenge to offline first with React Query #227
Then you just pass it globally to the queryClient defaults as persister and you also need to pass it individually for every infiniteQuery, as the global setting does not work for infiniteQueries. Types also broken, but it works.
One thing to mention: the experimental persister only detects and deletes old cache entries when the keys are accessed . This can lead to a lot of stale persisted data. I haven't finished it yet, but I am planning to add a tiny storage lookup on boot and remove data that is older than (3)/n days or something like that.
The issue is known and reported by me but unsolved for now
Activity
hirbod commentedon Mar 7, 2024
Let me give you the whole thing. And you have to use the experimental one, because this is what we need for RN.
Then you just pass it globally to the queryClient defaults as
persisterand you also need to pass it individually for every infiniteQuery, as the global setting does not work for infiniteQueries. Types also broken, but it works.hirbod commentedon Mar 7, 2024
One thing to mention: the experimental persister only detects and deletes old cache entries when the keys are accessed . This can lead to a lot of stale persisted data. I haven't finished it yet, but I am planning to add a tiny storage lookup on boot and remove data that is older than (3)/n days or something like that.
The issue is known and reported by me but unsolved for now
hirbod commentedon Mar 8, 2024
Here is my stale data remover https://gist.github.com/hirbod/bc1538990d1b47419c3cb1f6622f7625
flexbox commentedon Mar 8, 2024
@hirbod thanks!
so @MatthysDev owns you a drink at the next Appjs!