SlideShare a Scribd company logo
Using Redux
Maximising development efficiency
Static
websites
Singe Page
Applications
complexity
Refresh
page
LiveReload
CSS
time
HMR
(Hot Module Reload)
JS
(stateless
components)
HMR
JS
(everything)
Redux
Why Redux is natural
Demo: Redux in use
criticalcss.com
Performance, tooling, React
Penthouse - critical css generator
About me
@pocketjoso pocketjoso
Jonas Ohlsson - front end developer
https://jonassebastianohlsson.com
• Redux - overview
• criticalcss.com redux usage in practice
This talk
• Predictable State container (evolution of Flux)
• One single immutable State
• Reducers instead of Stores
• Hot Module Reloading and Time travel
• Modular, tiny (2kb!)
• Follows Best practice
What is Redux
Redux vs traditional Flux
Action Reducer
(Redux)
Store ViewRedux
Flux
Data flow
Today’s example
• Dispatch action for new generate job
• Update State via reducer
• Receive State in Component
Action creatorAction Reducer Store View
• Returns actions; does not dispatch them
• Write reducers instead of Stores
• Pure functions
• (state, action) => newState
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce
Reducers
ReducerAction Reducer Store View
Redux StoreAction Reducer Store View
Provider Connect
ViewAction Reducer Store
Redux using react-redux
Data flow with react-redux
(Store) Provider
• Wraps whole App
Provider
• Makes Store available to components
Store
ConnectConnect
• Injects props, subscribes to Store
• Keeps components Dumb
View
ConnectConnect View
• won’t work - actionCreator does not dispatch action
ConnectConnect View
• Connect auto-injects dispatch to props
Connect
• 2nd param creates self-dispatching action functions
Connect View
• write Reducers instead of Stores
• keep Components dumb using Connect
• benefit from:
• Hot Module Reloading
• Powerful DevTools
• Components easier to understand and test
Summary
That’s all!
Recommended packages
• Redux - https://github.com/rackt/redux
• React transform boilerplate (for Hot Module Reloading) - https://github.com/gaearon/react-
transform-boilerplate
• Redux DevTools - https://github.com/gaearon/redux-devtools
Redux resources
• Redux release and intro to Time travel - https://www.youtube.com/watch?v=xsSnOQynTHs
• Best starting point for understanding redux - Free video tutorial on Redux by Dan Abramov
(creator) - https://egghead.io/lessons/javascript-redux-the-single-immutable-state-tree
• Written notes for above video tutorial - https://gist.github.com/diegoconcha/
8918294bb9df69876b22
• Official docs (great) - http://rackt.org/redux/index.html
• Redux slim in a gist - https://gist.github.com/gaearon/ffd88b0e4f00b22c3159
Resources
Redux related resources
• Full stack Redux tutorial - http://teropa.info/blog/2015/09/10/full-stack-redux-tutorial.html
• Redux for state management - http://konkle.us/state-management-with-redux/
• Full stack Redux boilerplate - https://github.com/erikras/react-redux-universal-hot-example
• Support for Functional Components in React Transform -https://github.com/gaearon/babel-plugin-
react-transform/issues/57
• Beyond just Redux for async actions - riadbenguella.com/from-actions-creators-to-sagas-redux-
upgraded
Other related resources
• Webpack (react docs) - https://christianalfoni.github.io/react-webpack-cookbook/index.html
• Functional Stateless Components - http://tylermcginnis.com/functional-components-vs-stateless-
functional-components-vs-stateless-components/
• https://medium.com/@esamatti/react-js-pure-render-performance-anti-pattern-fb88c101332f
Resources

More Related Content

What's hot (20)

PDF
React.js and Redux overview
Alex Bachuk
 
PDF
How to Redux
Ted Pennings
 
PPTX
React + Redux + TypeScript === ♥
Remo Jansen
 
PDF
React & Redux
Federico Bond
 
PDF
Let's discover React and Redux with TypeScript
Mathieu Savy
 
PDF
Building React Applications with Redux
FITC
 
PPTX
Academy PRO: React JS. Redux & Tooling
Binary Studio
 
PPTX
A Brief Introduction to React.js
Doug Neiner
 
PPTX
React / Redux Architectures
Vinícius Ribeiro
 
PDF
React state managmenet with Redux
Vedran Blaženka
 
PDF
JS Chicago Meetup 2/23/16 - Redux & Routes
Nick Dreckshage
 
PPT
React js
Jai Santhosh
 
PDF
React state management with Redux and MobX
Darko Kukovec
 
PDF
Angular redux
Nir Kaufman
 
PDF
React.js in real world apps.
Emanuele DelBono
 
PPTX
Better web apps with React and Redux
Ali Sa'o
 
PDF
React and redux
Mystic Coders, LLC
 
PPTX
React & redux
Cédric Hartland
 
PDF
React for Dummies
Mitch Chen
 
PPTX
Redux training
dasersoft
 
React.js and Redux overview
Alex Bachuk
 
How to Redux
Ted Pennings
 
React + Redux + TypeScript === ♥
Remo Jansen
 
React & Redux
Federico Bond
 
Let's discover React and Redux with TypeScript
Mathieu Savy
 
Building React Applications with Redux
FITC
 
Academy PRO: React JS. Redux & Tooling
Binary Studio
 
A Brief Introduction to React.js
Doug Neiner
 
React / Redux Architectures
Vinícius Ribeiro
 
React state managmenet with Redux
Vedran Blaženka
 
JS Chicago Meetup 2/23/16 - Redux & Routes
Nick Dreckshage
 
React js
Jai Santhosh
 
React state management with Redux and MobX
Darko Kukovec
 
Angular redux
Nir Kaufman
 
React.js in real world apps.
Emanuele DelBono
 
Better web apps with React and Redux
Ali Sa'o
 
React and redux
Mystic Coders, LLC
 
React & redux
Cédric Hartland
 
React for Dummies
Mitch Chen
 
Redux training
dasersoft
 

Viewers also liked (20)

PPTX
Killer page load performance
Jonas Ohlsson Aden
 
PDF
Automating Faster Page Rendering - step by step from start to finish
Jonas Ohlsson Aden
 
PPTX
Isomorphic react in real life
Jonas Ohlsson Aden
 
PDF
Reduxについて
Yuusuke Takeuchi
 
PDF
`redux`と`flux`を比べてみたときの個人的な感想
佐藤 俊太郎
 
PDF
Let's Redux!
Joseph Chiang
 
PDF
Natural beauty
Pyramid Connections
 
PDF
Retail Loyalty Congress 2016 // Masterclass IceMobile
Anna Witteman
 
PDF
для клиентов франчайзинг
Marina Kirilyuk
 
PPTX
What’s next for the next generation of Recruiter? | Talent Connect 2016
LinkedIn Talent Solutions
 
PDF
Ready4S portfolio
Ready4S
 
PDF
Akamai State of the Internet Q4 2008
Amit Ranjan
 
PDF
Careering: Reflexivity, play and a life in the media - Pat Kane
www.patkane.global
 
PDF
10 Monsters from a Content Marketer’s Nightmare: A Halloween SlideSCARE
Uberflip
 
PDF
Kk dengan jamban yang sehat dari 5 kota
wely supriatna
 
PPTX
Raspberry pi 用アクセサリ
Tsuyoshi Horigome
 
PDF
Design Matters: Industrial Design & Product Styling in Wearable Tech
Christopher Grayson
 
PDF
Leveraging Social Media Optimization for Online Marketing
Tom Walls
 
PDF
Wicked ambiguity-content-strategy-140518173929-phpapp02
Vera Kovaleva
 
PDF
Working While Pregnant: 7 Most Pressing Questions Answered
lawsuitlegal
 
Killer page load performance
Jonas Ohlsson Aden
 
Automating Faster Page Rendering - step by step from start to finish
Jonas Ohlsson Aden
 
Isomorphic react in real life
Jonas Ohlsson Aden
 
Reduxについて
Yuusuke Takeuchi
 
`redux`と`flux`を比べてみたときの個人的な感想
佐藤 俊太郎
 
Let's Redux!
Joseph Chiang
 
Natural beauty
Pyramid Connections
 
Retail Loyalty Congress 2016 // Masterclass IceMobile
Anna Witteman
 
для клиентов франчайзинг
Marina Kirilyuk
 
What’s next for the next generation of Recruiter? | Talent Connect 2016
LinkedIn Talent Solutions
 
Ready4S portfolio
Ready4S
 
Akamai State of the Internet Q4 2008
Amit Ranjan
 
Careering: Reflexivity, play and a life in the media - Pat Kane
www.patkane.global
 
10 Monsters from a Content Marketer’s Nightmare: A Halloween SlideSCARE
Uberflip
 
Kk dengan jamban yang sehat dari 5 kota
wely supriatna
 
Raspberry pi 用アクセサリ
Tsuyoshi Horigome
 
Design Matters: Industrial Design & Product Styling in Wearable Tech
Christopher Grayson
 
Leveraging Social Media Optimization for Online Marketing
Tom Walls
 
Wicked ambiguity-content-strategy-140518173929-phpapp02
Vera Kovaleva
 
Working While Pregnant: 7 Most Pressing Questions Answered
lawsuitlegal
 
Ad

Similar to Using redux (20)

PPTX
Introduction to Redux.pptx
MohammadImran322154
 
PDF
Materi Modern React Redux Power Point.pdf
exiabreak
 
PDF
React Redux Interview Questions PDF By ScholarHat
Scholarhat
 
PDF
React Redux Interview Questions PDF By ScholarHat
Scholarhat
 
PDF
Getting started with React and Redux
Paddy Lock
 
PDF
ReactRedux.pdf
Arsalan malik
 
PPTX
an Introduction to Redux
Amin Ashtiani
 
PPTX
React js programming concept
Tariqul islam
 
PPTX
Redux workshop
Imran Sayed
 
PDF
An Introduction to Redux
NexThoughts Technologies
 
PDF
Using Redux with React
Dan Jipa
 
PDF
The Road To Redux
Jeffrey Sanchez
 
PDF
Redux essentials
Chandan Kumar Rana
 
PPTX
U3-02-React Redux and MUI.pptxaSDFGNXDASDFG
vinodkumarthatipamul
 
PPTX
Redux Tech Talk
Chathuranga Jayanath
 
PDF
#FrontConf2017 — Enhance your User (and Developer) Experience with React & Redux
phacks
 
PPTX
React gsg presentation with ryan jung & elias malik
Lama K Banna
 
PPTX
Damian Kmiecik - Road trip with Redux
PROIDEA
 
PDF
Overview of Redux
Yatin Gupta
 
PDF
Understanding redux
David Atchley
 
Introduction to Redux.pptx
MohammadImran322154
 
Materi Modern React Redux Power Point.pdf
exiabreak
 
React Redux Interview Questions PDF By ScholarHat
Scholarhat
 
React Redux Interview Questions PDF By ScholarHat
Scholarhat
 
Getting started with React and Redux
Paddy Lock
 
ReactRedux.pdf
Arsalan malik
 
an Introduction to Redux
Amin Ashtiani
 
React js programming concept
Tariqul islam
 
Redux workshop
Imran Sayed
 
An Introduction to Redux
NexThoughts Technologies
 
Using Redux with React
Dan Jipa
 
The Road To Redux
Jeffrey Sanchez
 
Redux essentials
Chandan Kumar Rana
 
U3-02-React Redux and MUI.pptxaSDFGNXDASDFG
vinodkumarthatipamul
 
Redux Tech Talk
Chathuranga Jayanath
 
#FrontConf2017 — Enhance your User (and Developer) Experience with React & Redux
phacks
 
React gsg presentation with ryan jung & elias malik
Lama K Banna
 
Damian Kmiecik - Road trip with Redux
PROIDEA
 
Overview of Redux
Yatin Gupta
 
Understanding redux
David Atchley
 
Ad

Recently uploaded (20)

PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Digital Circuits, important subject in CS
contactparinay1
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 

Using redux

  • 2. Static websites Singe Page Applications complexity Refresh page LiveReload CSS time HMR (Hot Module Reload) JS (stateless components) HMR JS (everything) Redux Why Redux is natural
  • 3. Demo: Redux in use criticalcss.com
  • 4. Performance, tooling, React Penthouse - critical css generator About me @pocketjoso pocketjoso Jonas Ohlsson - front end developer https://jonassebastianohlsson.com
  • 5. • Redux - overview • criticalcss.com redux usage in practice This talk
  • 6. • Predictable State container (evolution of Flux) • One single immutable State • Reducers instead of Stores • Hot Module Reloading and Time travel • Modular, tiny (2kb!) • Follows Best practice What is Redux
  • 7. Redux vs traditional Flux Action Reducer (Redux) Store ViewRedux Flux Data flow
  • 8. Today’s example • Dispatch action for new generate job • Update State via reducer • Receive State in Component
  • 9. Action creatorAction Reducer Store View • Returns actions; does not dispatch them
  • 10. • Write reducers instead of Stores • Pure functions • (state, action) => newState https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce Reducers
  • 13. Provider Connect ViewAction Reducer Store Redux using react-redux Data flow with react-redux
  • 14. (Store) Provider • Wraps whole App Provider • Makes Store available to components Store
  • 15. ConnectConnect • Injects props, subscribes to Store • Keeps components Dumb View
  • 16. ConnectConnect View • won’t work - actionCreator does not dispatch action
  • 17. ConnectConnect View • Connect auto-injects dispatch to props
  • 18. Connect • 2nd param creates self-dispatching action functions Connect View
  • 19. • write Reducers instead of Stores • keep Components dumb using Connect • benefit from: • Hot Module Reloading • Powerful DevTools • Components easier to understand and test Summary
  • 21. Recommended packages • Redux - https://github.com/rackt/redux • React transform boilerplate (for Hot Module Reloading) - https://github.com/gaearon/react- transform-boilerplate • Redux DevTools - https://github.com/gaearon/redux-devtools Redux resources • Redux release and intro to Time travel - https://www.youtube.com/watch?v=xsSnOQynTHs • Best starting point for understanding redux - Free video tutorial on Redux by Dan Abramov (creator) - https://egghead.io/lessons/javascript-redux-the-single-immutable-state-tree • Written notes for above video tutorial - https://gist.github.com/diegoconcha/ 8918294bb9df69876b22 • Official docs (great) - http://rackt.org/redux/index.html • Redux slim in a gist - https://gist.github.com/gaearon/ffd88b0e4f00b22c3159 Resources
  • 22. Redux related resources • Full stack Redux tutorial - http://teropa.info/blog/2015/09/10/full-stack-redux-tutorial.html • Redux for state management - http://konkle.us/state-management-with-redux/ • Full stack Redux boilerplate - https://github.com/erikras/react-redux-universal-hot-example • Support for Functional Components in React Transform -https://github.com/gaearon/babel-plugin- react-transform/issues/57 • Beyond just Redux for async actions - riadbenguella.com/from-actions-creators-to-sagas-redux- upgraded Other related resources • Webpack (react docs) - https://christianalfoni.github.io/react-webpack-cookbook/index.html • Functional Stateless Components - http://tylermcginnis.com/functional-components-vs-stateless- functional-components-vs-stateless-components/ • https://medium.com/@esamatti/react-js-pure-render-performance-anti-pattern-fb88c101332f Resources