"On UI side, I do the update first, then send the updates to backend". This is the right way.
I'm starting to see this very often, and recently learned that it's called "optimistic rendering/UI updates"
Definitely a pattern to explore
What if the request never gets to the backend? How do you deal with that? It means that your UI is now in a wrong state.
I suppose that would be a timeout error?
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
"On UI side, I do the update first, then send the updates to backend". This is the right way.
I'm starting to see this very often, and recently learned that it's called "optimistic rendering/UI updates"
Definitely a pattern to explore
What if the request never gets to the backend? How do you deal with that? It means that your UI is now in a wrong state.
I suppose that would be a timeout error?