0
Challenge · 71Architecture & State

Optimistic UI

Perfused in ~35% of apps

A like that waits 400ms for the server before the heart fills feels broken — users tap again, think it failed, leave. Optimistic UI shows the result instantly and reconciles with the server in the background, so the app feels as fast as the user's intent. It's the difference between an app that feels native and one that feels like a website from 2010.

Core idea. Update the UI immediately as if the action already succeeded, fire the request in the background, and on failure roll the UI back to the last known-good (server) value — trading a small risk of a visible rollback for a UI that feels instant.
Playground, this isn't a screenshot
<PostCard />in sync

Shipped optimistic UI to Pulse. Feels instant.

count24
server truth
24
on screen
24

The count moves the instant you click — before the server answers. On success the optimistic value is committed as the new truth; with server will fail on, the rejected request rolls backto the server's count.

↑ play a little first, then dig in