Deep down the rabbit hole of state management and server cache
summary
Argues that local UI state and server cache need different solutions, demonstrating with Vue + Pinia and Vue Query (react-query) cache instead of custom flags; shows a live Alice characters app, sets staleTime 5s demo (suggesting real apps use minutes), and discovers the default retry is 3 retries then reduces it to 1. Implements fetching, per-id queries, a mutation that posts a new Caterpillar and updates cache with setQueryData — the UI reflects the change and the approach works.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:07State management complexity
- 3:19Evolving with server data
- 9:21Local vs server cache
- 10:25Live coding Vue Query
- 18:54Client-side caching with staleTime
- 20:18Fetching single character
- 22:08Mutating server cache
- 26:24Advanced features & closing
related talks
25mLocal State and Server Cache: Finding a Balance
24mLocal State and Server Cache: Finding a Balance
50mClean Async State Management
28mLocal state and server cache: how to balance them with vue-query
44mData Management in Vue
30mManaging State Management
22mYou might not need Vuex
52mState management in a GraphQL era
