Local State and Server Cache: Finding a Balance
summary
Compares Vuex/Redux for local state with Apollo Client and react-query/view-query for server cache and claims one tool should not try to solve both. Demonstration uses REST + axios on a local server (port 4000), implements useQuery/useMutation, shows default retry = 3, shows cache considered stale by default so staleTime default causes refetch on remount, and contrasts invalidateQueries vs setQueryData for updating cache — both work, manual cache update avoids the extra refetch.
AI-written summary · about
chapters (4)
- 0:00Start
- 0:05Local state and server cache: finding a balance
- 8:30Apollo Client
- 10:20One size doesn't fit all
related talks
24mLocal State and Server Cache: Finding a Balance
28mLocal state and server cache: how to balance them with vue-query
27mDeep down the rabbit hole of state management and server cache
22mYou might not need Vuex
37mAll you need is l̶o̶v̶e Apollo Client
52mState management in a GraphQL era
52mManaging Remote State in React
25mReact Query Under the Hood
