Início
Conheça mais
Enviar pesquisa
Carregar
Entrar
Cadastre-se
Anúncio
Check these out next
Getting started with Redux js
Citrix
Introduction to React & Redux
Boris Dinkevich
React + Redux. Best practices
Clickky
React + Redux + TypeScript === ♥
Remo Jansen
Using redux
Jonas Ohlsson Aden
React state managmenet with Redux
Vedran Blaženka
React.js and Redux overview
Alex Bachuk
Introduction to Redux
Ignacio Martín
1
de
78
Top clipped slide
Better React state management with Redux
24 de Mar de 2017
•
0 gostou
3 gostaram
×
Seja o primeiro a gostar disto
mostrar mais
•
626 visualizações
visualizações
×
Vistos totais
0
No Slideshare
0
De incorporações
0
Número de incorporações
0
Baixar agora
Baixar para ler offline
Denunciar
Tecnologia
Workshop at BoostJS abut doing better React state management with Redux.
Maurice De Beijer [MVP]
Seguir
The Problem Solver
Anúncio
Anúncio
Anúncio
Recomendados
ProvJS: Six Months of ReactJS and Redux
Thom Nichols
835 visualizações
•
40 slides
Let's discover React and Redux with TypeScript
Mathieu Savy
724 visualizações
•
71 slides
Designing applications with Redux
Fernando Daciuk
1.2K visualizações
•
82 slides
State Models for React with Redux
Stephan Schmidt
3.9K visualizações
•
47 slides
Redux js
Nils Petersohn
3.5K visualizações
•
21 slides
Building React Applications with Redux
FITC
2.1K visualizações
•
42 slides
Mais conteúdo relacionado
Apresentações para você
(20)
Getting started with Redux js
Citrix
•
469 visualizações
Introduction to React & Redux
Boris Dinkevich
•
705 visualizações
React + Redux. Best practices
Clickky
•
5.8K visualizações
React + Redux + TypeScript === ♥
Remo Jansen
•
12.5K visualizações
Using redux
Jonas Ohlsson Aden
•
3.4K visualizações
React state managmenet with Redux
Vedran Blaženka
•
484 visualizações
React.js and Redux overview
Alex Bachuk
•
558 visualizações
Introduction to Redux
Ignacio Martín
•
6.9K visualizações
React & redux
Cédric Hartland
•
301 visualizações
Redux training
dasersoft
•
224 visualizações
Angular redux
Nir Kaufman
•
5.6K visualizações
React / Redux Architectures
Vinícius Ribeiro
•
278 visualizações
React for Dummies
Mitch Chen
•
7.1K visualizações
Academy PRO: React JS. Redux & Tooling
Binary Studio
•
422 visualizações
React, Flux and a little bit of Redux
Ny Fanilo Andrianjafy, B.Eng.
•
795 visualizações
Introduction to react and redux
Cuong Ho
•
1.5K visualizações
Switch to React.js from AngularJS developer
Eugene Zharkov
•
1.2K visualizações
Better web apps with React and Redux
Ali Sa'o
•
200 visualizações
React & Redux
Craig Jolicoeur
•
327 visualizações
React Lifecycle and Reconciliation
Zhihao Li
•
2.8K visualizações
Destaque
(17)
Jmmatthewslaw
jmmatthewslawpa
•
307 visualizações
Hayalimdeki Okulum
Şule Eşgi
•
392 visualizações
4 pilareseducación
Carla Diaz Diaz
•
284 visualizações
My journey from Fragile, to Agile and now DevOps
Jason Man
•
899 visualizações
DigiRap International Photography Award Winners 2016: Category Travel (Colour)
maditabalnco
•
1.4K visualizações
The busy developer guide to Docker
Maurice De Beijer [MVP]
•
444 visualizações
Из глубины седых веков (изучение нравственного наследия)
DROFA-VENTANA
•
242 visualizações
コメントスパム対策から始まったWordPress生活
毅 佐藤
•
1.3K visualizações
Questionnaire results
asmediac16
•
125 visualizações
Confined space – hazards –risk –control measures
Anand Prakash
•
9.7K visualizações
Ab censeñanza ddhh
Carla Diaz Diaz
•
167 visualizações
RxJS + Redux + React = Amazing
Jay Phelps
•
29.8K visualizações
React JS and why it's awesome
Andrew Hull
•
107.9K visualizações
Sim, windi silviana, hapzi ali, sistem pengambilan keputusan, universitas mer...
windi silviana
•
219 visualizações
Deep freezer
servicesdeep
•
2.1K visualizações
3Com 160036000
savomir
•
57 visualizações
Os scheduling Algorithms
Neelamani Samal
•
250 visualizações
Anúncio
Similar a Better React state management with Redux
(20)
The new React
Maurice De Beijer [MVP]
•
324 visualizações
The productive developer guide to React
Maurice De Beijer [MVP]
•
1.3K visualizações
Why I am hooked on the future of React
Maurice De Beijer [MVP]
•
358 visualizações
Building large and scalable mission critical applications with React
Maurice De Beijer [MVP]
•
194 visualizações
I am hooked on React
Maurice De Beijer [MVP]
•
641 visualizações
Why I am hooked on the future of React
Maurice De Beijer [MVP]
•
501 visualizações
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
•
152 visualizações
Building high-performance web applications with Preact
Maurice De Beijer [MVP]
•
435 visualizações
Building high performance web applications
Maurice De Beijer [MVP]
•
341 visualizações
Building high performance web applications
Maurice De Beijer [MVP]
•
306 visualizações
React gsg presentation with ryan jung & elias malik
Lama K Banna
•
86 visualizações
Building high performance web applications
Maurice De Beijer [MVP]
•
265 visualizações
Building reliable applications with React, C#, and Azure
Maurice De Beijer [MVP]
•
203 visualizações
Jaoo Michael Neale 09
Michael Neale
•
751 visualizações
React suspense, not just for Alfred Hitchcock
Maurice De Beijer [MVP]
•
160 visualizações
React js programming concept
Tariqul islam
•
1.3K visualizações
Web Performance & Latest in React
Talentica Software
•
65 visualizações
Painless Migrations from Backbone to React/Redux
Jim Sullivan
•
338 visualizações
Continuous Deployment of your Application @JUGtoberfest
Marcin Grzejszczak
•
1.5K visualizações
0900 learning-react
RohitYadav696
•
321 visualizações
Mais de Maurice De Beijer [MVP]
(17)
A foolproof Way to Estimate a Software Project
Maurice De Beijer [MVP]
•
27 visualizações
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
•
123 visualizações
Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
•
251 visualizações
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
•
245 visualizações
Concurrent Rendering Adventures in React 18
Maurice De Beijer [MVP]
•
214 visualizações
Why I am hooked on the future of React
Maurice De Beijer [MVP]
•
171 visualizações
Building reliable web applications using Cypress
Maurice De Beijer [MVP]
•
193 visualizações
Getting started with React Suspense and concurrent rendering
Maurice De Beijer [MVP]
•
120 visualizações
From zero to hero with the Reactive extensions for JavaScript
Maurice De Beijer [MVP]
•
355 visualizações
From zero to hero with the reactive extensions for JavaScript
Maurice De Beijer [MVP]
•
192 visualizações
Create flexible React applications using GraphQL apis
Maurice De Beijer [MVP]
•
438 visualizações
Create flexible react applications using GraphQL API's
Maurice De Beijer [MVP]
•
223 visualizações
Docker for a .NET web developer
Maurice De Beijer [MVP]
•
358 visualizações
From zero to hero with the reactive extensions for JavaScript
Maurice De Beijer [MVP]
•
473 visualizações
Docker containers on Windows
Maurice De Beijer [MVP]
•
650 visualizações
From zero to hero with the reactive extensions for java script
Maurice De Beijer [MVP]
•
358 visualizações
Tooling for the productive front end developer
Maurice De Beijer [MVP]
•
442 visualizações
Anúncio
Último
(20)
Learnings From Shipping 1000+ Streaming Data Pipelines To Production with Hak...
HostedbyConfluent
•
0 visão
Deep Dive into Kafka Connect Protocol with Catalin Pop
HostedbyConfluent
•
0 visão
Fourth-Industrial-Revolution-by-DR-SA-KANU.ppt
MdAbdullaAlMamun20
•
0 visão
solar panel.pptx
AbdulberBaig
•
0 visão
如何办理一份高仿科克大学毕业证成绩单?
aazepp
•
0 visão
如何办理一份高仿伦敦南岸大学毕业证成绩单?
aazepp
•
0 visão
Pytexas: Build ChatGPT over SMS in Python
Elizabeth (Lizzie) Siegle
•
0 visão
Networking Hardware Requirements.pptx
JhamaikaPaet
•
0 visão
jsday 2023: Build ChatGPT over SMS in Italy
Elizabeth (Lizzie) Siegle
•
0 visão
Lesson-01.pptx
ssuserc24e05
•
0 visão
Bench, a Framework for Benchmarking Kafka Using K8s and OpenMessaging Benchma...
HostedbyConfluent
•
0 visão
Memory Matters: Drift Detection with a Low Memory Footprint for ML Models on ...
HostedbyConfluent
•
0 visão
如何办理一份高仿东伦敦大学毕业证成绩单?
aazepp
•
0 visão
Apache Flink on Kafka: Reliable Data Pipelines Everyone Can Code with Ela Demir
HostedbyConfluent
•
0 visão
Testing SMTs? Testcontainers to the Rescue! with Fábio Sequeira & Mafalda Santos
HostedbyConfluent
•
0 visão
AI-Driven Market Research Platform
Prasanna Hegde
•
0 visão
Playing with Xbox Data with Dale Lane
HostedbyConfluent
•
0 visão
Generate Art with DALL·E 2 and Twilio MMS.pptx
Elizabeth (Lizzie) Siegle
•
0 visão
Material Requisition for 2" Autonomous Robotic Fire Suppression System for We...
RogerJames25
•
0 visão
Segment Data Analytics for Indie Developers: KCDC 2023
Elizabeth (Lizzie) Siegle
•
0 visão
Better React state management with Redux
Better React state management with
Redux Maurice de Beijer @mauricedb @react_tutorial
Workshop goal Short recap:
what is React? Learn the three principals of Redux Use the different Redux components Unit testing Redux code Adding Redux to a React application Use Redux middleware © ABL - The Problem Solver 2
Maurice de
Beijer The Problem Solver Microsoft Azure MVP Freelance developer/instructor Twitter: @mauricedb and @React_Tutorial Web: http://www.TheProblemSolver.nl E-mail: maurice.de.beijer@gmail.com 3
Follow along Git
repository: https://github.com/mauricedb/nitflex-redux Slides: http://bit.ly/react-redux-workshop © ABL - The Problem Solver 4
Type it out by
hand? © ABL - The Problem Solver 5 “Typing it drills it into your brain much better than simply copying and pasting it.You're forming new neuron pathways.Those pathways are going to help you in the future. Help them out now!”
Prerequisites Install Node &
NPM © ABL - The Problem Solver 6
Install Node.js & NPM © ABL
- The Problem Solver 7
Short recap What is
React? © ABL - The Problem Solver 8
React © ABL -
The Problem Solver 9 “React is a JavaScript library for building user interfaces” - Facebook -
React features React uses
a component based architecture Components are written using the JSX syntax React likes a one way data flow React uses a virtual DOM © ABL - The Problem Solver 10
React Component © ABL -
The Problem Solver 11
Nitflex The sample application ©
ABL - The Problem Solver 12
Nitflex © ABL -
The Problem Solver 13
Main components © ABL -
The Problem Solver 14 Application Login Main Page Header Billboard Genre List Genre* Movie* Expanded Movie Playing Movie
Stateful components © ABL -
The Problem Solver 15 Application Login Main Page Header Billboard Genre List Genre* Movie* Expanded Movie Playing Movie
Clone Nitflex & NPM install ©
ABL - The Problem Solver 16
Redux © ABL -
The Problem Solver 17
Redux © ABL -
The Problem Solver 18 “Redux is a predictable state container for JavaScript apps” - Dan Abramov -
Three principals of Redux Single
source of truth State is read-only Changes are made with pure functions © ABL - The Problem Solver 19
Single source of truth
The application state is stored in a single location Do not scatter the state over lots of components A single state location makes it easier to reason about and debug your application © ABL - The Problem Solver 20
State is read-only The
state objects are never changed by the application Every state change is the result of an action being dispatched to the store This action describes the intended state change © ABL - The Problem Solver 21
Changes with pure functions Reducers
are pure functions that take the current state and an action as input and return a new state object The previous state object is never modified © ABL - The Problem Solver 22
UI versus App state
Redux should be used for application state. Do not store UI state in Redux! © ABL - The Problem Solver 23
Login example © ABL -
The Problem Solver 24
Installing Redux © ABL -
The Problem Solver 25
ReduxComponents © ABL -
The Problem Solver 26
Redux Components Actions Reducers
The store © ABL - The Problem Solver 27
Login action © ABL -
The Problem Solver 28
Login reducer © ABL -
The Problem Solver 29
combineReducers © ABL -
The Problem Solver 30
Unit testing © ABL
- The Problem Solver 31
Unit test the action
creator © ABL - The Problem Solver 32
Unit test the reducer ©
ABL - The Problem Solver 33
Redux and React ©
ABL - The Problem Solver 34
Redux and React The NPM
react-redux package contains the React bindings for Redux The <Provider> component makes the Redux store available The connect() function connects React components to the Redux store use in <Provider> © ABL - The Problem Solver 35
Create store © ABL
- The Problem Solver 36
Dispatch login action © ABL
- The Problem Solver 37
Get the user from
the store © ABL - The Problem Solver 38
Cleanup app-container.jsx Remove
user and loginAsUser() app-presentation.jsx Remove loginAsUser() © ABL - The Problem Solver 39
Redux Middleware © ABL
- The Problem Solver 40
Redux Middleware © ABL -
The Problem Solver 41 “Redux middleware provides a third-party extension point between dispatching an action, and the moment it reaches the reducer” - Dan Abramov -
Installing redux-thunk © ABL -
The Problem Solver 42
Redux-Thunk © ABL -
The Problem Solver 43
What is a Thunk? ©
ABL - The Problem Solver 44 “A thunk is a subroutine that is created, often automatically, to assist a call to another subroutine” -Wikipedia -
Configure Thunk Middleware © ABL -
The Problem Solver 45
Update the Actions © ABL -
The Problem Solver 46
Add movies reducer © ABL
- The Problem Solver 47
Update the reducers index.js © ABL
- The Problem Solver 48
Extract movies from store © ABL -
The Problem Solver 49
Cleanup app-container.jsx Remove
allMovies and passing movies to AppPresentation © ABL - The Problem Solver 50
Redux DevTools © ABL
- The Problem Solver 51
Redux DevTools © ABL -
The Problem Solver 52
Redux DevTools © ABL -
The Problem Solver 53
Remember the user ©
ABL - The Problem Solver 54
Remember the user © ABL
- The Problem Solver 55
Playing and stopping movies ©
ABL - The Problem Solver 56
Add actions © ABL
- The Problem Solver 57
Update reducer © ABL -
The Problem Solver 58
Start playing © ABL -
The Problem Solver 59
Retrieve the playing movie from the
store in app- presentation © ABL - The Problem Solver 60
Retrieve the playing movie from the
store in playing- movie © ABL - The Problem Solver 61
Cleanup app-container.jsx main-page/index.jsx
genre-list.jsx genre-row.jsx © ABL - The Problem Solver 62
Filtering movies © ABL
- The Problem Solver 63
Filtering movies The list
of filtered movies are derived from state © ABL - The Problem Solver 64
Add action © ABL
- The Problem Solver 65
Reducer © ABL -
The Problem Solver 66
Filter- movies.jsx © ABL -
The Problem Solver 67
App- presentation. jsx © ABL -
The Problem Solver 68
Cleanup Header.jsx Remove
filterMovies Main-page/index.jsx Remove filterMovies © ABL - The Problem Solver 69
Remove app-container The AppContainer is
no longer needed. © ABL - The Problem Solver 70
Index.js © ABL -
The Problem Solver 71
Connect only to required
movie data © ABL - The Problem Solver 72
Main-page © ABL -
The Problem Solver 73
Genre-list © ABL -
The Problem Solver 74
Billboard © ABL -
The Problem Solver 75
App- presentation © ABL -
The Problem Solver 76
Bonus Exercises Extract updating
localStorage from user reducer and do this with middleware The user is passed from AppPresentation => MainPage => Header © ABL - The Problem Solver 77
MauricedeBeijer @mauricedb maurice.de.beijer @gmail.com © ABL -
The Problem Solver 78
Anúncio