SlideShare a Scribd company logo
1 of 20
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

More Related Content

What's hot

React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
Marcin Grzywaczewski
 

What's hot (20)

Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
 
Production optimization with React and Webpack
Production optimization with React and WebpackProduction optimization with React and Webpack
Production optimization with React and Webpack
 
An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js
 
MEAN stack
MEAN stackMEAN stack
MEAN stack
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 
Bootstrapping angular js with bower grunt yeoman
Bootstrapping angular js with bower grunt yeomanBootstrapping angular js with bower grunt yeoman
Bootstrapping angular js with bower grunt yeoman
 
Webpack Introduction
Webpack IntroductionWebpack Introduction
Webpack Introduction
 
Webpack DevTalk
Webpack DevTalkWebpack DevTalk
Webpack DevTalk
 
Introduction of webpack 4
Introduction of webpack 4Introduction of webpack 4
Introduction of webpack 4
 
Web application I have always dreamt of
Web application I have always dreamt ofWeb application I have always dreamt of
Web application I have always dreamt of
 
Webpack
Webpack Webpack
Webpack
 
Nuxt Talk
Nuxt TalkNuxt Talk
Nuxt Talk
 
Nuxt.js - Introduction
Nuxt.js - IntroductionNuxt.js - Introduction
Nuxt.js - Introduction
 
Bundling your front-end with Webpack
Bundling your front-end with WebpackBundling your front-end with Webpack
Bundling your front-end with Webpack
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
 
Angular 1.5 Components
Angular 1.5 ComponentsAngular 1.5 Components
Angular 1.5 Components
 
GlassFish v3 : En Route Java EE 6
GlassFish v3 : En Route Java EE 6GlassFish v3 : En Route Java EE 6
GlassFish v3 : En Route Java EE 6
 
NodeSummit - MEAN Stack
NodeSummit - MEAN StackNodeSummit - MEAN Stack
NodeSummit - MEAN Stack
 
Webpack 살펴보기
Webpack 살펴보기Webpack 살펴보기
Webpack 살펴보기
 

Viewers also liked

brocade-five-pillars-federal-data-centers-wp (1)
brocade-five-pillars-federal-data-centers-wp (1)brocade-five-pillars-federal-data-centers-wp (1)
brocade-five-pillars-federal-data-centers-wp (1)
Vince Garr
 

Viewers also liked (20)

React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
 
003. ReactJS basic
003. ReactJS basic003. ReactJS basic
003. ReactJS basic
 
Intro to ReactJS
Intro to ReactJSIntro to ReactJS
Intro to ReactJS
 
004. Working with React component
004. Working with React component004. Working with React component
004. Working with React component
 
Starting with Reactjs
Starting with ReactjsStarting with Reactjs
Starting with Reactjs
 
React + Redux for Web Developers
React + Redux for Web DevelopersReact + Redux for Web Developers
React + Redux for Web Developers
 
RxJS + Redux + React = Amazing
RxJS + Redux + React = AmazingRxJS + Redux + React = Amazing
RxJS + Redux + React = Amazing
 
React lecture
React lectureReact lecture
React lecture
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Workshop 22: ReactJS Redux Advanced
Workshop 22: ReactJS Redux AdvancedWorkshop 22: ReactJS Redux Advanced
Workshop 22: ReactJS Redux Advanced
 
brocade-five-pillars-federal-data-centers-wp (1)
brocade-five-pillars-federal-data-centers-wp (1)brocade-five-pillars-federal-data-centers-wp (1)
brocade-five-pillars-federal-data-centers-wp (1)
 
A Taste Of Glory
A Taste Of GloryA Taste Of Glory
A Taste Of Glory
 
Climate Change
Climate ChangeClimate Change
Climate Change
 
Surgery trip manual - Oct 2011
Surgery trip manual - Oct 2011Surgery trip manual - Oct 2011
Surgery trip manual - Oct 2011
 
Artikel. På Ferie i Jernalderen (2010)
Artikel. På Ferie i Jernalderen (2010)Artikel. På Ferie i Jernalderen (2010)
Artikel. På Ferie i Jernalderen (2010)
 
Περιγραφή ιδέας ECONET
Περιγραφή ιδέας ECONETΠεριγραφή ιδέας ECONET
Περιγραφή ιδέας ECONET
 
JP byvandring langs Nørrevold - 14.06.14
JP byvandring langs Nørrevold - 14.06.14JP byvandring langs Nørrevold - 14.06.14
JP byvandring langs Nørrevold - 14.06.14
 
Travel Guide for the End Times
Travel Guide for the End TimesTravel Guide for the End Times
Travel Guide for the End Times
 
REUECDLpaper
REUECDLpaperREUECDLpaper
REUECDLpaper
 
sujit resume
sujit resumesujit resume
sujit resume
 

Similar to 006. React - Redux framework

Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0
Mayank Srivastava
 
VMware Vsan vtug 2014
VMware Vsan vtug 2014VMware Vsan vtug 2014
VMware Vsan vtug 2014
csharney
 
Deployment of DevOps Environment with CA Solutions
Deployment of DevOps Environment with CA SolutionsDeployment of DevOps Environment with CA Solutions
Deployment of DevOps Environment with CA Solutions
Nic Swart
 

Similar to 006. React - Redux framework (20)

React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016
 
Integrating React.js Into a PHP Application: Dutch PHP 2019
Integrating React.js Into a PHP Application: Dutch PHP 2019Integrating React.js Into a PHP Application: Dutch PHP 2019
Integrating React.js Into a PHP Application: Dutch PHP 2019
 
React on rails v4
React on rails v4React on rails v4
React on rails v4
 
Using redux
Using reduxUsing redux
Using redux
 
JS Chicago Meetup 2/23/16 - Redux & Routes
JS Chicago Meetup 2/23/16 - Redux & RoutesJS Chicago Meetup 2/23/16 - Redux & Routes
JS Chicago Meetup 2/23/16 - Redux & Routes
 
From PHP to React - case study
From PHP to React - case studyFrom PHP to React - case study
From PHP to React - case study
 
Academy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & ToolingAcademy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & Tooling
 
Backbone.js with React Views - Server Rendering, Virtual DOM, and More!
Backbone.js with React Views - Server Rendering, Virtual DOM, and More!Backbone.js with React Views - Server Rendering, Virtual DOM, and More!
Backbone.js with React Views - Server Rendering, Virtual DOM, and More!
 
Matheus Marsiglio - Isomorphic React + Redux App
Matheus Marsiglio - Isomorphic React + Redux AppMatheus Marsiglio - Isomorphic React + Redux App
Matheus Marsiglio - Isomorphic React + Redux App
 
Web services Hand_Out
Web services Hand_OutWeb services Hand_Out
Web services Hand_Out
 
Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0
 
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
 
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer ReplacementMidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
 
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
 
VMware Vsan vtug 2014
VMware Vsan vtug 2014VMware Vsan vtug 2014
VMware Vsan vtug 2014
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)
 
Server Side React for WordPress by Muhammad Muhsin @ The JavaScript for WordP...
Server Side React for WordPress by Muhammad Muhsin @ The JavaScript for WordP...Server Side React for WordPress by Muhammad Muhsin @ The JavaScript for WordP...
Server Side React for WordPress by Muhammad Muhsin @ The JavaScript for WordP...
 
Deployment of DevOps Environment with CA Solutions
Deployment of DevOps Environment with CA SolutionsDeployment of DevOps Environment with CA Solutions
Deployment of DevOps Environment with CA Solutions
 
VMware virtual SAN 6 overview
VMware virtual SAN 6 overviewVMware virtual SAN 6 overview
VMware virtual SAN 6 overview
 
React gsg presentation with ryan jung & elias malik
React   gsg presentation with ryan jung & elias malikReact   gsg presentation with ryan jung & elias malik
React gsg presentation with ryan jung & elias malik
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Recently uploaded (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

006. React - Redux framework

  • 2. ReactJS - Redux ❖ Why Redux ❖ Store, Actions and Reducer ❖ Redux Alternatives
  • 3. 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)
  • 6. ReactJS - without Redux vs with Redux
  • 7. ReactJS - more about Redux Read more: ★ https://css-tricks.com/learning-react-redux/ ★ https://blog.jumpcut.com/why-redux-why-now- 32b3f95b59b#.4drj7z90i
  • 8. ReactJS - Redux terms Terms in Redux ❖ Application state ➢ State vs Stateless ❖ Reducers ❖ Store ❖ Provider ❖ Actions ❖ Dispatch
  • 9. ReactJS - Redux flow Basic flow ❖ Application state ❖ Reducers ❖ Store ❖ Provider ❖ Actions ❖ Dispatch
  • 10. ReactJS - Redux side effects with API middleware Side effects with API middleware ❖ Application state ❖ Reducers ❖ Store ❖ Provider ❖ Actions ❖ Dispatch
  • 11. ReactJS - Redux flow More explanations: ★ https://github.com/reactjs/redux/issues/653
  • 12. 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
  • 15. Provider Provider is top Component that used to connect Redux store and React Component
  • 16. 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().
  • 17. Dispatch Dispatch is the method of sending data from component to store for processing according to specific action.