Replies: 1 comment 5 replies
-
Since a mutation response will never override a query state, I'm a bit at a loss. Can you give a more explicit example? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's say I have a select input.
A user expects that UI reflects one's choice immediately.
I've implemented an optimistic update approach: update the local state with a user's choice and send a request.
A request takes some time to fulfill. In the situation when a user decides to change the input immediately after the previous choice two requests are being sent. When the first response arrives it overwrites the state with the previous choice, when the second response arrives it overwrites the state with the second choice.
How to prevent such behavior, so that only the most recent mutation response updates the state?
Beta Was this translation helpful? Give feedback.
All reactions