A Cocktail of Smooth Data Fetching for Better UX
summary
A concrete recipe: use a centralized query cache (queries keyed by arrays) so simultaneous components reuse the same promise, mark data stale after 5s to auto-refetch, and prefer client-side refetch/refresh over ad hoc state hacks. Build optimistic mutations by inserting a temporary negative-ID item into the cache and rolling back on error. Small plugins prove the point: Pina Colada is ~3KB gz and a delay spinner (400ms) avoids flashy loading states; follow Nielsen timings (<100ms instant, 1s notice, >10s needs streaming).
AI-written summary · about
chapters (10)
- 0:00Introduction and speaker intro
- 1:05History of UX and friction
- 8:45Suspense and loading states
- 11:13What is Pinia Colada?
- 16:49Centralized data and cache
- 21:41Perceived performance tricks
- 26:15Fetching ahead and stale data
- 31:35Optimistic updates
- 37:19Error handling in optimistic updates
- 39:30Key takeaways and summary
