T
TanStack11mo ago
fair-rose

Persisting mutations for offline

As far as I understand it RQ supports offline in that it can paused mutations while you're offline and then resume them again. However, what if we want offline to support e.g. the app being closed and thus requiring persisting the mutations (e.g. the variables/context) that got passed to them. Is there an established pattern here?
3 Replies
extended-salmon
extended-salmon11mo ago
yes, the persister plugins
extended-salmon
extended-salmon11mo ago
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.
From An unknown user
From An unknown user
conscious-sapphire
conscious-sapphire10mo ago
Can you explain how this works or what the limitations are? I am trying to use this in react native app with mmkv as storage. In my use case, I need everything offline first with optimistic updates and depending on network change we push changes. Mutation also takes two steps, first uploading an image and then POSTing say a book with that image ID. https://github.com/TanStack/query/discussions/8147 There's some discussion here. Not sure how to achieve this or if this is the correct way to do it. Or should I have a simple write queue and push those changes to server on event?

Did you find this page helpful?