Elixir is fast, but not everyone on the planet is having a fast internet connection. Optimistic UI (previously called Latency Compensation) is a concept first introduced by Meteor framework.
Let me explain what Optimistic UI / Latency Compensation is:
For example you’re sending a message through a chatbox.
In traditional way:
- You typed the message
- pressed enter or clicked send button
- the browser sent an ajax request
- the data was stored in the database at server
- the server sent an OK response
- the message got copied from the textarea to the messages list
- the textarea got cleared.
In Optimistic UI way:
- You typed a message
- You pressed enter / clicked send button
- Message got copied directly to the message list, and the text area got cleared
-> rest of the process of sending message to the server, saving to database, OK response from server everything was done in the background.
So the Latency Compensation / Optimistic UI way feels a lot faster to the user, and it makes the UI bearable if the internet is slow.
(for details on Latency Compensation / Optimistic UI, read the linked post).
I asked Meteor team, if this feature can be used outside Meteor? They replied that Apollo client (for Graphql) which is created by the same team provides that feature under the name Optimistic UI.