Redux , React Redux
and Redux Thunk
Nabil Md Shahid
Senior Software Engineer at Cefalo
Why Redux?
What problem does it solves?
The Problem: Props Drilling
Redux Dataflow
Reducer
Action
State
View
Redux Dataflow
Reducer
Action
State
View
Event
Redux Dataflow
Action
Reducer
Action
State
View
Redux Dataflow
Action
Reducer
Action State
State
View
Redux Dataflow
Reducer
Action
State
View
Updated State
Code Example: Store setup
Reducer
Action
State
View
Code Example: Integrate with React
Redux Middlewares
● Redux middleware is a powerful feature that allows you to extend the capabilities of
Redux
● Intercepting actions before they reach the reducers
Middleware
Reducer
Action
State
View
Redux Thunk
● Redux thunk is a middleware to handle async logic
● A thunk is actually a function that is dispatched from a component
Redux Thunk Dataflow
API
Action / Thunk Middleware
Action
Reducer
Action
State
View
Redux Thunk: Implementation
Thank You
Questions? Comments?