SlideShare a Scribd company logo
fabiobiondi.io
REDUX TOOLKIT
Google Developer Expert (Angular)
Microsoft MVP
Formazione front-end
Speaker & Content Creator
Community Founder
Twitch Partner
fabiobiondi.io
fabiobiondi.io
Google Expert
in Angular
fabiobiondi.io
Javascript ES6 & Typescript
React
Redux fundamentals
REQUIREMENTS
WHAT YOU SHOULD KNOW TO FOLLOW THIS SESSION
fabiobiondi.io
WHAT’S REDUX?
fabiobiondi.io
Global State Manager for JS apps
Design Pattern used in React, Angular, ...
Single Source of Truth
(one state, aka store)
fabiobiondi.io
Code Isolation:
state, actions, (side) effects, selectors
Debuggable
Time Travel Debug w/ Redux DevTools
fabiobiondi.io
REDUX DEVTOOLS
fabiobiondi.io
ACTIONS history
Action Payload
fabiobiondi.io
current State (STORE)
ACTIONS history
fabiobiondi.io
Diff with previous state
fabiobiondi.io
fabiobiondi.io
REDUX FLOW
(A TYPICAL “Async” SCENARIO)
fabiobiondi.io
C
C C
C C
C C
C C
C
C C
C
action
selectors
Middleware & Reducers
fabiobiondi.io
C
C C
C C
C C
C C
C
C C
C
action selectors
Smart Component
(aka Container)
Router
Middleware & Reducers
Presentational
Components (Dumb)
fabiobiondi.io
SideEffects
XHR, Routing,
LocalStorage Store
Middleware
thunk, saga, …
Action
addUserSuccess
Reducer
Update State
props callbacks
Presentational
Components
C
C C
C
Container Selectors
getUsers
Action
addUser
fabiobiondi.io
fabiobiondi.io
REACT REDUX HOOKS
npm install react-redux
fabiobiondi.io
useSelector & useDispatch
fabiobiondi.io
Dispatcher
Actions
fabiobiondi.io
State selector
fabiobiondi.io
fabiobiondi.io
REDUX TOOLKIT
npm install @reduxjs/toolkit
fabiobiondi.io
1. A framework to simplify Redux setup
2. Opinionated
3. Utilities: Thunk, Immer.js, devTools, …
4. Effective
fabiobiondi.io
fabiobiondi.io
configureStore
fabiobiondi.io
Store Shape
fabiobiondi.io
Reducers
Store Type
Store
fabiobiondi.io
Store Reference
fabiobiondi.io
createAction
Notify something has happened
fabiobiondi.io
Action Creators
fabiobiondi.io
createReducer
How state changes
when an action is dispatched
fabiobiondi.io
Initial Value
Action Types State Update
Current State & Action
fabiobiondi.io
fabiobiondi.io
immer.js
is now part of Redux Toolkit
fabiobiondi.io
fabiobiondi.io
createSlice
( actions & reducers in one step 🙅 )
fabiobiondi.io
Initial State
Slice Name
Action Creators
+
Reducer
Export Actions
fabiobiondi.io
Import reducers
from Slices
fabiobiondi.io
ASYNC ACTIONS with
Thunk Middleware
fabiobiondi.io
Thunk
(async action)
fabiobiondi.io
Slice now should be updated
to handle Async actions
fabiobiondi.io
Thunk Type
Hook to get dispatch fn
Dispatch Type
fabiobiondi.io
fabiobiondi.io
fabiobiondi.io
FACEBOOKCOMMUNITIES

More Related Content

What's hot (20)

PDF
react redux.pdf
Knoldus Inc.
 
PPTX
React + Redux Introduction
Nikolaus Graf
 
PDF
Introduction to Redux
Ignacio Martín
 
PPTX
reactJS
Syam Santhosh
 
PPTX
React workshop
Imran Sayed
 
PPTX
Introduction to React JS for beginners | Namespace IT
namespaceit
 
PPTX
Intro to React
Eric Westfall
 
PPTX
React hooks
Ramy ElBasyouni
 
PPTX
Introduction to React JS for beginners
Varun Raj
 
PPTX
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
PPT
React js
Jai Santhosh
 
PDF
React js
Rajesh Kolla
 
PDF
React Context API
NodeXperts
 
PDF
React and redux
Mystic Coders, LLC
 
PPTX
React js
Oswald Campesato
 
PDF
WEB DEVELOPMENT USING REACT JS
MuthuKumaran Singaravelu
 
PPTX
Introduction to React
Rob Quick
 
PPTX
Redux workshop
Imran Sayed
 
PPTX
react-slides.pptx
DayNightGaMiNg
 
PDF
Workshop 21: React Router
Visual Engineering
 
react redux.pdf
Knoldus Inc.
 
React + Redux Introduction
Nikolaus Graf
 
Introduction to Redux
Ignacio Martín
 
reactJS
Syam Santhosh
 
React workshop
Imran Sayed
 
Introduction to React JS for beginners | Namespace IT
namespaceit
 
Intro to React
Eric Westfall
 
React hooks
Ramy ElBasyouni
 
Introduction to React JS for beginners
Varun Raj
 
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
React js
Jai Santhosh
 
React js
Rajesh Kolla
 
React Context API
NodeXperts
 
React and redux
Mystic Coders, LLC
 
WEB DEVELOPMENT USING REACT JS
MuthuKumaran Singaravelu
 
Introduction to React
Rob Quick
 
Redux workshop
Imran Sayed
 
react-slides.pptx
DayNightGaMiNg
 
Workshop 21: React Router
Visual Engineering
 

Similar to Redux Toolkit - Quick Intro - 2022 (20)

PDF
Introduction to Redux (for Angular and React devs)
Fabio Biondi
 
PDF
React Redux Interview Questions PDF By ScholarHat
Scholarhat
 
PDF
React Redux Interview Questions PDF By ScholarHat
Scholarhat
 
PPTX
Damian Kmiecik - Road trip with Redux
PROIDEA
 
PDF
How to Redux
Ted Pennings
 
PDF
redux and angular - up and running
Nir Kaufman
 
PPTX
Introduction to Redux.pptx
MohammadImran322154
 
PDF
React Redux Tutorial | Redux Tutorial for Beginners | React Redux Training | ...
Edureka!
 
PDF
ReactRedux.pdf
Arsalan malik
 
PDF
Redux with angular 2 - workshop 2016
Nir Kaufman
 
PDF
Angular2 and Redux - up & running - Nir Kaufman - Codemotion Amsterdam 2016
Codemotion
 
PDF
Redux Toolkit & RTK Query in TypeScript: tips&tricks
Fabio Biondi
 
PDF
Redux in Angular 2+
Hùng Nguyễn Huy
 
PDF
Data architectures in Angular & NGRX Introduction
Fabio Biondi
 
PPTX
an Introduction to Redux
Amin Ashtiani
 
PPTX
downloads_introduction to redux.pptx
NavneetKumar111924
 
PPTX
Let's start with REDUX
Cubet Techno Labs
 
PDF
React.js and Redux overview
Alex Bachuk
 
PPTX
Better React state management with Redux
Maurice De Beijer [MVP]
 
PDF
Understanding redux
David Atchley
 
Introduction to Redux (for Angular and React devs)
Fabio Biondi
 
React Redux Interview Questions PDF By ScholarHat
Scholarhat
 
React Redux Interview Questions PDF By ScholarHat
Scholarhat
 
Damian Kmiecik - Road trip with Redux
PROIDEA
 
How to Redux
Ted Pennings
 
redux and angular - up and running
Nir Kaufman
 
Introduction to Redux.pptx
MohammadImran322154
 
React Redux Tutorial | Redux Tutorial for Beginners | React Redux Training | ...
Edureka!
 
ReactRedux.pdf
Arsalan malik
 
Redux with angular 2 - workshop 2016
Nir Kaufman
 
Angular2 and Redux - up & running - Nir Kaufman - Codemotion Amsterdam 2016
Codemotion
 
Redux Toolkit & RTK Query in TypeScript: tips&tricks
Fabio Biondi
 
Redux in Angular 2+
Hùng Nguyễn Huy
 
Data architectures in Angular & NGRX Introduction
Fabio Biondi
 
an Introduction to Redux
Amin Ashtiani
 
downloads_introduction to redux.pptx
NavneetKumar111924
 
Let's start with REDUX
Cubet Techno Labs
 
React.js and Redux overview
Alex Bachuk
 
Better React state management with Redux
Maurice De Beijer [MVP]
 
Understanding redux
David Atchley
 
Ad

More from Fabio Biondi (15)

PDF
React - Component Based Approach
Fabio Biondi
 
PDF
Introduction to E2E in Cypress
Fabio Biondi
 
PDF
Create your React 18 / TS bundle using esbuild
Fabio Biondi
 
PDF
Create Web Components using Google Lit
Fabio Biondi
 
PDF
React Typescript for beginners: Translator app with Microsoft cognitive services
Fabio Biondi
 
PDF
RXJS Best (& Bad) Practices for Angular Developers
Fabio Biondi
 
PDF
Introduction for Master Class "Amazing Reactive Forms"
Fabio Biondi
 
PDF
RxJS & Angular Reactive Forms @ Codemotion 2019
Fabio Biondi
 
PDF
Angular & RXJS: examples and use cases
Fabio Biondi
 
PDF
Angular Day 2018 (italy) - Keynote - The Amazing World of Angular 6
Fabio Biondi
 
PDF
Angular Best Practices @ Firenze 19 feb 2018
Fabio Biondi
 
PDF
React: JSX and Top Level API
Fabio Biondi
 
PDF
Intro evento: evolvere un applicazione Angular con Rxjs e Redux
Fabio Biondi
 
PDF
Single Page Applications in Angular (italiano)
Fabio Biondi
 
PDF
Angular 2 - Core Concepts
Fabio Biondi
 
React - Component Based Approach
Fabio Biondi
 
Introduction to E2E in Cypress
Fabio Biondi
 
Create your React 18 / TS bundle using esbuild
Fabio Biondi
 
Create Web Components using Google Lit
Fabio Biondi
 
React Typescript for beginners: Translator app with Microsoft cognitive services
Fabio Biondi
 
RXJS Best (& Bad) Practices for Angular Developers
Fabio Biondi
 
Introduction for Master Class "Amazing Reactive Forms"
Fabio Biondi
 
RxJS & Angular Reactive Forms @ Codemotion 2019
Fabio Biondi
 
Angular & RXJS: examples and use cases
Fabio Biondi
 
Angular Day 2018 (italy) - Keynote - The Amazing World of Angular 6
Fabio Biondi
 
Angular Best Practices @ Firenze 19 feb 2018
Fabio Biondi
 
React: JSX and Top Level API
Fabio Biondi
 
Intro evento: evolvere un applicazione Angular con Rxjs e Redux
Fabio Biondi
 
Single Page Applications in Angular (italiano)
Fabio Biondi
 
Angular 2 - Core Concepts
Fabio Biondi
 
Ad

Recently uploaded (20)

PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
July Patch Tuesday
Ivanti
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

Redux Toolkit - Quick Intro - 2022