An optimistic update updates the UI immediately, assuming a server request will succeed, instead of waiting for the response. This makes the app feel instant — but you must handle the case where the request actually fails by rolling back.
Kontrasten
Pessimistic (normal): click → show spinner → wait for server → THEN update UI (feels slow)
Optimistic: click → update UI INSTANTLY → send request →
if it fails, ROLL BACK the change (feels instant)
