Using awaitTxId() after a backend transaction that updates multiple collections
If I have a backend transaction that updates multiple tables (so multiple collections are affected), and I get its txid,
would doing this on the client work as expected?
My idea is to use createOptimisticAction like this:
Does this make sense, and would it work as expected?
I want to have an optimistic action without changing my backend logic, for cases where the backend transaction updates multiple collections.
2 Replies
metropolitan-bronze•3w ago
Yup! That's the exact pattern we recommend
metropolitan-bronze•3w ago
Mutations | TanStack DB Docs
TanStack DB Mutations TanStack DB provides a powerful mutation system that enables optimistic updates with automatic state management. This system is built around a pattern of optimistic mutation → ba...