useOptimistic sounds simple — update the UI before the server responds. But what about rollbacks, race conditions, and stale closures? We'll build a real-world optimistic flow from scratch, break it in every way possible, and fix each case.
The race condition demo was wild. Definitely rethinking my approach.
Great breakdown of the rollback flow.
Can you share the repo? Want to study the stale closure fix.