Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is `optimistic updates` in front-end development

I'm reading the intro to redux pattern, and there is the following paragraph there:

... consider the new requirements becoming common in front-end product development, such as handling optimistic updates, rendering on the server, fetching data before performing route transitions, and so on.

My question is what is optimistic updates here?

like image 290
Max Koretskyi Avatar asked Oct 08 '15 07:10

Max Koretskyi


People also ask

What is optimistic updates?

An optimistic UI update is an update in the user interface showing the final result even before the change requested to the server has returned a success. In other words, the UI changes to the result even before receiving a response from the server.

What is optimistic rendering?

Unlike the pessimistic approach, the optimistic approach does not wait for the server to trigger the event's success state. Instead, it is optimistic about the success of the server call it will make and acts accordingly.

What is optimistic UI?

Optimistic UI is a pattern that you can use to simulate the results of a mutation and update the UI even before receiving a response from the server. Once the response is received from the server, the optimistic result is thrown away and replaced with the actual result.


1 Answers

In an optimistic update the UI behaves as though a change was successfully completed before receiving confirmation from the server that it actually was - it is being optimistic that it will eventually get the confirmation rather than an error. This allows for a more responsive user experience.

like image 117
doublesharp Avatar answered Oct 15 '22 22:10

doublesharp