Embracing Modern State Management with Redux Toolkit (RTK) v5.
Whether you're upgrading an existing app to the officially recommended, opinionated approach for writing Redux applications or you're starting a new project and are wondering if Redux Toolkit is worth your time -- this talk is for you.
Discover how RTK v5 transforms state management by making everything type-safe, eliminating boilerplate, and simplifying your codebase. We'll explore its powerful new tools and features for creating scalable, maintainable applications with ease.
This session breaks down the core concepts of RTK, including slices, listener middleware, streamlined store setup, and the powerful createAsyncThunk
utility. Along the way, you'll gain practical tips and strategies for migrating your existing Redux setup.
Say goodbye to boilerplate and hello to a new era of Redux development—Redux reborn!
Simple example of a legacy Redux implementation.
cd redux-legacy
npm install
npm start
- Basic example & Setup with a small todo app
createSlice
, the (included) Immer library and (separate)useImmer
package.
cd redux-modern
npm install
npm start
- RTK Query with
createApi
createAsyncThunk
andcreateSelector
from the (included) reselect library
Add a Todo:
- Present findings on devs.gent
- Talk about ReduxJS/Toolkit and migrating.
- classComponents: dispatch ReduxJS/Toolkit actions
- createEntityAdapter: for all your CRUD needs (ready-made reducers & selectors!)
- listenerMiddleware: recommended alternative for RXJS, Sagas, ...
- thunkCancellation: Auto-Complete: whenever the needle changes, we're no longer interested in previous results