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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With