Redux Examples

The same ToDo app, written twice: once the old way, once with Redux Toolkit.

Legacy Redux

The canonical ToDo app

Add a todo, toggle it, fetch a list. Three actions, and already there are ACTION_TYPE constants, hand-written action creators, a switch reducer, spread operators nested three levels deep and a connect() wrapper with mapStateToProps and mapDispatchToProps.

Show me the boilerplate →

Modern Redux

The same ToDo app

One createSlice: action types, action creators and reducer in a single object, with Immer letting those reducers mutate state directly and still hand back a new immutable tree.

Show me the slice →

Modern Redux

Mythical Zoos & Enchanted Wilds

Dragons and unicorns in a glowing mythical zoo

Two fantasy worlds built on the same fake backend, each one showing a different way to get server data into Redux — so you can compare them side by side.

🏰 Mythical Zoos

RTK Query: createApi generates the hooks, the cache, the loading flags and the invalidation. No reducers, no thunks, no fetch.

🌿 Enchanted Wilds

The same screens with createAsyncThunk and createSelector, for when you need to own the request and derive state yourself.

Visit the zoos →

Blog series

ReduxJS/Toolkit, written out

Every example on this page is explained, step by step, on the itenium blog.

  1. ReduxJS/Toolkit — why it exists and what it replaces
  2. Immer — mutate state, get an immutable tree
  3. createSlice & configureStore — the whole store, minus the boilerplate
  4. createAsyncThunk — the Enchanted Wilds, explained
  5. TypeScript — typing the store, thunks and hooks
  6. createSelector — memoized, derived state with Reselect
  7. createApi — under construction