← Back to portfolio

Optimistic updates, visualized

Like or comment on a post and watch the UI update immediately — before the network call resolves. Tune latency and failure rate below. When a request fails, the optimistic change is rolled back and logged, the same mechanism behind a responsive-feeling like button, cart or chat screen in React Native. No backend; the “server” below is a timer in your browser.

700ms
25%
Optimistic: the tap updates count and liked locally and the button shows a small pending dot while the request is in flight; on failure the local change reverts. Pessimistic: the button disables and spins; the UI only changes once the server responds. Perceived latency is what the tracker below measures — the time between tap and the screen looking done, which is 0ms for a committed optimistic update and the full round trip otherwise.

Built by Pushpendra Mishra — React Native / React engineer. Vanilla JS, one file, theme-aware. Code reference: public-demos/optimistic-updates-rollback-demo · read the case study →