Skip to content
Discussion options

You must be logged in to vote

I think your code looks fine, and there isn't much react-query (or the frontend in general) can do here (except debounce the mutations maybe): queries can be cancelled to not override outgoing mutations, but if you fire off two mutations at the same time, I think it's the server's responsibility to handle concurrent modifications (ignore them or queue them).

In your example, given a serverState of "a", I typed "b" and then "c" and got the following log output (I also added the values to the logs):

- started POSTing ab to the server (this will overwrite a on the server) with a delay of 1s 
- started POSTing abc to the server (this will overwrite a on the server) with a delay of 0.3s 
- fin…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mvasin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants