Provide example usage with mutations in Tanstack query #16
Replies: 2 comments 2 replies
-
The mutations are done in the mutationFn. The example in the readme show doing fetch calls to a backend API. There's also a full example in the repo you can look at. This isn't meant to be used with Tanstack/query, it's rather a replacement for when you're building with a sync engine The goal here is to make optimistic updates very easy -- not everyone will need it but if you're building an app with extensive optimistic updates and lots of backend changes (especially unpredictable ones or in multi-user or agentic apps) then this will be really helpful. |
Beta Was this translation helpful? Give feedback.
-
I reviewed the full React example and understand it now. I posted this discussion because someone on X mentioned rewriting their optimistic updates in the I was looking for an example and a compelling reason to migrate from the already simple |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm really interested in understanding the need for this project, as optimistic updates have never been a problem for me using Tanstack Query.
The README only gave an example implementation in ElectricSQL. In which I was really expecting an example with actual Tanstack stuffs like Tanstack Query. In most cases, I only happen to perform optimistic updates during mutations ( with
useMutation
). So please, give an example.Beta Was this translation helpful? Give feedback.
All reactions