Replies: 6 comments 5 replies
|
Please be more specific with your question. What about the code you showed isn’t working for you? |
|
I would like to be sure that all the data I have downloaded will remain in the browser and will be displayed in the application in, say, two days. Is the code I have a good solution, or is there something better? The thing is, the application will be available offline as a PWA (I still need to spend some time here to get the PWA working, because something isn't loading :D). |
|
@TkDodo Is it possible to create by you guys, out-of-the-box persister that uses IndexedDB. The problem was, when i hade a ~15k rows (rows with children) send to client into expandable table with virtualization. Layout: |
|
Example of IndexedDB persister - https://tanstack.com/query/latest/docs/framework/react/plugins/persistQueryClient#building-a-persister Example of localStorage in async persister - https://tanstack.com/query/latest/docs/framework/react/plugins/persistQueryClient#persistqueryclientprovider |
|
I made this for offline first experience: https://github.com/LinkdJulioFlores/LinkdJulioFlores-tanstack-start-offline-first-pwa |
|
Your setup is close, but I would change two things for a real offline PWA. First, use IndexedDB instead of The usual pattern is: set |
Uh oh!
There was an error while loading. Please reload this page.
I'm currently working on app with PWA that needs to support offline access to data using TanStack Query. I’ve already set up a persister, but I’m unsure about the best practices for configuring it to ensure that all necessary queries are available offline — especially for use cases where a user might open the app the next day without internet access and still expect full functionality.
A few specific questions I have:
All reactions