Network-first, persisted cache fallback strategy using React Query #9863
Unanswered
bacarybruno
asked this question in
Q&A
Replies: 1 comment 3 replies
-
|
I guess, but your first and last point kinda contradict each other? “The app always tries the API first” does that also apply when the app restarts? I’m confused. Our persisters will always read from the persisted storage before trying any API requests, then you’ll get that data back and if its stale or there is no data, you’ll get a fetch. On the very first attempt, the data in the persisted storage is just empty so it’ll read that empty data and will make a request after that. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello 👋
I’m working on a React Native app and I would like to implement the following strategy:
Is
persistQueryClientadapted for this use case? 🙏Beta Was this translation helpful? Give feedback.
All reactions