From a hook-based server-state library
If your data fetching is built on the useQuery/useMutation pattern — a query-key cache, staleTime, refetchOnWindowFocus, invalidateQueries — this page covers what carries over almost unchanged, and the three gaps in that model that Flux exists to close: hard reload, offline, and multi-tab.
- An existing setup using a hook-based server-state / data-fetching library (query keys, mutations, cache invalidation)
- A state manager Flux can write into — Zustand, Redux, Jotai, or Stunk — see state_managers/zustand
- Familiarity with api/register and api/bootstrap on the client side
The pattern, not the library
Where the two models overlap almost exactly
Gap 1 — staleTime doesn't survive a reload
staleTime only helps within a session. A hard reload throws the whole in-memory cache away, every time, for every user.Gap 2 — refetchOnWindowFocus fires blind
Gap 3 — offline mutations have no home
onError rolls back an optimistic update, but the user's edit is simply gone unless something persists and retries it.Gap 4 — no cross-tab awareness
Cache invalidation, mapped directly
What doesn't change
When this migration isn't worth it
Migrating incrementally
A store's registration and bootstrap call are independent of every other registered store — there is no global switch that forces the whole app onto Flux at once.
Unlike hook-based querying libraries where hook invocations couple component trees directly to fetch boundaries, Flux moves synchronization out of render lifecycles entirely into background worker coordination and store adapters.
For what a browser-native cache does and doesn't replace in general, see core_concepts/what_flux_is_not. For the offline queue mechanics referenced in Step 5, see core_concepts/offline_queue. For cross-tab leader election referenced in Step 6, see core_concepts/browser_physics.