storagePersister and staleTime Infinity
Hello,
I understand that createAsyncStoragePersister and createSyncStoragePersister create a snapshot of the current queryClient. If I use "staleTime: Infinity" the query will never be called again if I don't invalidate it.
That said, is there any property I can set so that the data is always invalidated when the app (React Native) is restarted? Or is doing it manually already good?
1 Reply
rival-black•3y ago
Do you want it to happen everytime the app refocuses or only starting? Not enterily sure if this fits your usecase but maybe use focusManger?
Or maybe you can use the onSuccess on Provider? (Haven't tried it, but should work something like this)