Redux
--Rahil Memon--
Redux ?
● A Predictable state container for JavaScript apps
● Inspired by FLUX.
● BUT WHY State Container ? WHY Redux,
● What Problems does Redux Solve ?
● Let’s Understand it in detail.
COMPONENTS Are Building Blocks of React
Application.
Each Component Represent part of Web App.
ToDo App
ToDo App
ToDo App
ToDo App
The component-based approach of React.
The component-based approach of React
and other frontend frameworks like Vue and Angular has changed the way
our web looks like today.
Example, John!
Example, John!
Store
Redux Store, Single source of Truth.
Let’s Code Redux.
Store?
● It's just an object with a few methods on it.
● A store holds the whole state tree of your application.
● The only way to change the state inside it is to dispatch an action on it.
Reducer ?
Reducers specify how the application's state changes in response to
actions sent to the store.
Remember that actions only describe what happened, but don't describe how the
application's state changes.
store.dispatch()
Dispatches an action. This is the only way to trigger a state change
store.getState()
Returns the current state tree of your application. It is equal to the last value
returned by the store's reducer.
Connect().
The connect() function connects a React component to a Redux store.
ToDO With Redux
Redux Saga
--Rahil Memon--
Redux Saga.
Redux-saga is a redux middleware library, that is designed to make handling side
effects in your redux app nice and simple.
It achieves this by leveraging an ES6 feature called Generators.
Generators.
Generators, allowing us to write asynchronous code that looks synchronous, and
is very easy to test.
Thank You
--Rahil Memon--

React redux-redux-saga-rahil-memon