KEMBAR78
006. React - Redux framework | PPTX
006. REDUX FRAMEWORK
Presenter: Binh Quan
ReactJS - Redux
❖ Why Redux
❖ Store, Actions and Reducer
❖ Redux Alternatives
ReactJS - Why Redux
❖ State management for whole system
❖ One store / Multiple Reducers
❖ Connecting React components
❖ Dispatching events
❖ Server rendering (you don’t need any special API to manage)
ReactJS - without Redux
ReactJS - with Redux
ReactJS - without Redux vs with Redux
ReactJS - more about Redux
Read more:
★ https://css-tricks.com/learning-react-redux/
★ https://blog.jumpcut.com/why-redux-why-now-
32b3f95b59b#.4drj7z90i
ReactJS - Redux terms
Terms in Redux
❖ Application state
➢ State vs Stateless
❖ Reducers
❖ Store
❖ Provider
❖ Actions
❖ Dispatch
ReactJS - Redux flow
Basic flow
❖ Application state
❖ Reducers
❖ Store
❖ Provider
❖ Actions
❖ Dispatch
ReactJS - Redux side effects with API
middleware
Side effects
with
API middleware
❖ Application state
❖ Reducers
❖ Store
❖ Provider
❖ Actions
❖ Dispatch
ReactJS - Redux flow
More explanations:
★ https://github.com/reactjs/redux/issues/653
Reducers
The Reducer is function that takes
the previous state and an action,
processing previous state then
return next state.
Note:
❖ Each reducer often contains
initial state
❖ Next state is not that old state
with modification. It’s
completely a new object
New state (object) is
returned after
processing old state
Store
Store with single reducer
Store
Store with multiple reducers
Provider
Provider is top Component that
used to connect Redux store and
React Component
Actions
Actions are payloads of information
that send data from your
application to your store. They are
the only source of information for
the store. You send them to the
store using store.dispatch().
Dispatch
Dispatch is the method of sending
data from component to store for
processing according to specific
action.
Get application
state
Bind dispatch to
React Component
Now Demo

006. React - Redux framework

  • 1.
  • 2.
    ReactJS - Redux ❖Why Redux ❖ Store, Actions and Reducer ❖ Redux Alternatives
  • 3.
    ReactJS - WhyRedux ❖ State management for whole system ❖ One store / Multiple Reducers ❖ Connecting React components ❖ Dispatching events ❖ Server rendering (you don’t need any special API to manage)
  • 4.
  • 5.
  • 6.
    ReactJS - withoutRedux vs with Redux
  • 7.
    ReactJS - moreabout Redux Read more: ★ https://css-tricks.com/learning-react-redux/ ★ https://blog.jumpcut.com/why-redux-why-now- 32b3f95b59b#.4drj7z90i
  • 8.
    ReactJS - Reduxterms Terms in Redux ❖ Application state ➢ State vs Stateless ❖ Reducers ❖ Store ❖ Provider ❖ Actions ❖ Dispatch
  • 9.
    ReactJS - Reduxflow Basic flow ❖ Application state ❖ Reducers ❖ Store ❖ Provider ❖ Actions ❖ Dispatch
  • 10.
    ReactJS - Reduxside effects with API middleware Side effects with API middleware ❖ Application state ❖ Reducers ❖ Store ❖ Provider ❖ Actions ❖ Dispatch
  • 11.
    ReactJS - Reduxflow More explanations: ★ https://github.com/reactjs/redux/issues/653
  • 12.
    Reducers The Reducer isfunction that takes the previous state and an action, processing previous state then return next state. Note: ❖ Each reducer often contains initial state ❖ Next state is not that old state with modification. It’s completely a new object New state (object) is returned after processing old state
  • 13.
  • 14.
  • 15.
    Provider Provider is topComponent that used to connect Redux store and React Component
  • 16.
    Actions Actions are payloadsof information that send data from your application to your store. They are the only source of information for the store. You send them to the store using store.dispatch().
  • 17.
    Dispatch Dispatch is themethod of sending data from component to store for processing according to specific action.
  • 18.
  • 19.
  • 20.