Optimistic UI Updates
Published on August 14, 2019← Back to tips
Are you doing a lot of API Calls that change data in UI after some user input? Consider updating the UI before the change is registered.
If any of the API fails, then it’s much less costlier to reverse the update.
More Reading? Setting up cancellable optimistic UI updates in redux fashion by @brechtbilliet
Fact: @firefox actually does optimistic UI updates for the browser UI since Version 60 (Firefox Quantum). Before a tab is opened, the UI actually changes state to include a new tab before the setup process has completed.
This may feel like a minor change, but the impact of the user’s experience is huge. The UI feels instant and by the time a user can enter the URL and navigate, browser would have done its work and will be ready for the next operation.