-
TLDR: introduce an option I’m using The easiest way to ensure this behaviour is to hold back sending B until A has finished. So far I have been doing this myself, with a helper that chains together the promises of mutations with the same key (see In my specific use case, I want to piggyback the patches from previously failed mutations on new mutations, to effectively re-try them when a new mutation is issued. With my current approach, I get this behaviour:
Hence, from my point of view, the major benefit of this library offering the queuing functionality would be that the library can ensure that the effects of previous mutations are visible to the next mutation. Here is a code sandbox that demonstrates how previous failures are not visible to the next query with my approach:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Not really sure yet why, but it seems that the mutations are all there, in the correct state. |
Beta Was this translation helpful? Give feedback.
-
I think we have this now with mutation scopes: https://tanstack.com/query/latest/docs/framework/react/guides/mutations#mutation-scopes |
Beta Was this translation helpful? Give feedback.
I think we have this now with mutation scopes: https://tanstack.com/query/latest/docs/framework/react/guides/mutations#mutation-scopes