Reader small image

You're reading from  Full Stack Web Development with Remix

Product typeBook
Published inNov 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781801075299
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Andre Landgraf
Andre Landgraf
author image
Andre Landgraf

Andre is a full stack developer from Germany. He graduated with an MS in Information Systems from the Technical University of Munich and was also awarded an MS in Computer Science from Sofia University in Palo Alto. Andre currently lives in Cupertino, California, and he works as a Software Engineer at LinkedIn. Andre loves learning, writing, and speaking about all things web. In his free time, he tutors aspiring developers and builds for the web.
Read more about Andre Landgraf

Right arrow

Considering optimistic UI

The source of truth of a web application is usually stored remotely in a database. We can only be sure that a mutation succeeded after updating the database and receiving confirmation from the server. The UI response to a mutation is thereby delayed until we hear back from the server.

Optimistic UI is a pattern that’s used to provide instant feedback to users while waiting for an execution to resolve. When updating the UI optimistically, we apply a UI update before receiving the definitive response from the server. Most of the time, our mutations succeed, so why wait for a server response? In this section, we will discuss some trade-offs of optimistic UI updates.

Communicating rollbacks

Updating the UI optimistically speeds up the perceived response time when the optimistic state aligns with the server response. When the optimistic update does not align with the server response, then optimistic updates need to be rolled back or corrected. This...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Full Stack Web Development with Remix
Published in: Nov 2023Publisher: PacktISBN-13: 9781801075299

Author (1)

author image
Andre Landgraf

Andre is a full stack developer from Germany. He graduated with an MS in Information Systems from the Technical University of Munich and was also awarded an MS in Computer Science from Sofia University in Palo Alto. Andre currently lives in Cupertino, California, and he works as a Software Engineer at LinkedIn. Andre loves learning, writing, and speaking about all things web. In his free time, he tutors aspiring developers and builds for the web.
Read more about Andre Landgraf