What Redux Does
- Single source of truth — one global state tree
- State is read-only — updated via dispatched actions
- Pure reducers —
(state, action) => newState - DevTools — time-travel debugging
- Middleware — thunks, sagas, listeners for side-effects
- RTK Query — server state with caching (alternative to React Query)
- createSlice — auto-generate actions + reducers
- Immer — write mutating code, RTK converts to immutable
Architecture
Dispatched action → reducer(s) → new state → subscribers rerender. Store holds state, useSelector subscribes, useDispatch sends actions. Middleware intercepts actions for async work.
Self-Hosting
Client library only.
Key Features
- Redux DevTools browser extension
- Time-travel debugging
- RTK Query (server state)
- createSlice / createAsyncThunk
- Listener middleware
- TypeScript-first
- React, Vue, Angular, Svelte bindings
- SSR-compatible
Comparison
| Library | Boilerplate | DevTools | Server State | Size |
|---|---|---|---|---|
| Redux Toolkit | Low | Best | RTK Query | ~13KB |
| Zustand | Minimal | Redux DevTools | No | ~1KB |
| Jotai | Atomic | Yes | Via suspense | ~3KB |
| Valtio | Minimal | Yes | No | ~3KB |
| MobX | Reactive | Yes | No | ~15KB |
FAQ
Q: Is Redux obsolete? A: No. Code written with RTK is about as concise as Zustand, but you keep DevTools time travel and maintainability at scale.
Q: RTK Query vs React Query? A: Features overlap. RTK Query fits into the Redux ecosystem and shares the store; React Query is lighter with a cleaner API.
Q: When should I use Redux vs Zustand? A: Very large apps, strict architecture, cross-team collaboration → Redux. Small-to-medium apps that prize simplicity → Zustand.
Sources & Credits
- Docs: https://redux.js.org
- RTK: https://redux-toolkit.js.org
- GitHub: https://github.com/reduxjs/redux
- License: MIT