/**
* useOptimistic — a React hook for instant UI updates with server reconciliation.
*
* The problem: user clicks "like," you send a request to the server, and
* the UI waits 200ms before updating. Feels sluggish.
*
* The solution: update immediately with the expected state, then reconcile
* when the server responds. If the server disagrees, roll back gracefully.
*
* This handles the hard parts: concurrent mutations, race conditions,
* error rollback, and retry with exponential backoff.
*/
useOptimistic.ts