Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The Redux The State Management
Search
Sastra Nababan
June 22, 2017
Programming
2
96
The Redux The State Management
Sastra Nababan
June 22, 2017
Tweet
Share
More Decks by Sastra Nababan
See All by Sastra Nababan
Developer Circles Overview
sastranababan
0
87
Getting Started with ReactJs & Ecosystem
sastranababan
1
220
Javascript Ecosystem Overview
sastranababan
0
80
Functional Programming Javascript
sastranababan
2
370
SADIA
sastranababan
0
130
Other Decks in Programming
See All in Programming
go test -json そして testing.T.Attr / Kyoto.go #63
utgwkk
3
290
GitHubとGitLabとAWS CodePipelineでCI/CDを組み比べてみた
satoshi256kbyte
4
220
「待たせ上手」なスケルトンスクリーン、 そのUXの裏側
teamlab
PRO
0
500
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
290
TDD 実践ミニトーク
contour_gara
1
290
時間軸から考えるTerraformを使う理由と留意点
fufuhu
15
4.7k
為你自己學 Python - 冷知識篇
eddie
1
350
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
Improving my own Ruby thereafter
sisshiki1969
1
160
250830 IaCの選定~AWS SAMのLambdaをECSに乗り換えたときの備忘録~
east_takumi
0
390
AWS発のAIエディタKiroを使ってみた
iriikeita
1
180
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
1.2k
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
72
11k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.5k
How STYLIGHT went responsive
nonsquared
100
5.8k
What's in a price? How to price your products and services
michaelherold
246
12k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
Faster Mobile Websites
deanohume
309
31k
Thoughts on Productivity
jonyablonski
70
4.8k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
How GitHub (no longer) Works
holman
315
140k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
920
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
Into the Great Unknown - MozCon
thekraken
40
2k
Transcript
Redux The State Management Sastra Nababan By
What is Redux ? Predictable state container for Javascript Apps
✓ State Management ✓ State Container ✓ Data Binding Also known as frontend javascript library for :
What is State Anyway ? Hey…. You keep talking about
state
State is….. Memory/Space to hold your app information ✓ Data
✓ Communication ✓ Action ✓ Session ✓ Location
Server Client Send Request Process & Rendering 1 3 2
Server Send Rendered Page Client Most of your app state stay here Server Side Rendering
Server Client Send Request Process & Rendering 1 3 2
Server Send Data Client Most of your app state stay here Client Side Rendering Now your state lives here too 4 Client Rendering
Things become complex & crazy App Growth
Can Redux Help ? Yes, Let Redux do that things
for you
Why Redux so popular in react world ? React Redux
+
React app made by component hierarchy
Component Communication The Challange is…..
Component Communication Scenario Parent to Child Child to Parent
Component Communication Scenario Sibling to Sibling Any to Any
Can you image this ?
Ok now let’s talk about Redux
How to learn Redux ? ✓ Understand the big picture
✓ Get familiar with basic functional programming ‣ Pure Function ‣ Filter ‣ Map ‣ Reduce ‣ Compose ‣ Immutability
When to use Redux ? If you aren't sure if
you need it, you don't need it. - Pete Hunt I would like to amend this: don't use Redux until you have problems with vanilla React. - Dan Abramov “ “ Today. - Sastra Nababan “
Redux Principle 1 of 3 Single source of truth It’s
called store. Whole application state stored here
Server Client Client Side Rendering with Redux
React Component Communication with Redux
React app made by component hierarchy
Redux Principle 2 of 3 State is read only The
only way to change the state is to emit an action
Redux Principle 3 of 3 Changes are made with pure
functions The only way to change the state is to emit an action
Redux Architecture Components in app Actions Store Reducer store.dispatch(action)
Store is… Plain object of app state
Action
Reducer
Advanced Topic
Middleware The moment point between dispatching an action & reducer
Components in app Actions Store Reducer store.dispatch(action) Middleware • logging • crash reporting • asynchronous API • routing • etc
Async ✓ redux-thunk ✓ redux-promises ✓ redux-sagas ( es6 generator
) How to manage async process ?
Redux Persist How to Store data locally ? ✓ HTML5
Local Storage ✓ redux-persist ✓ redux-storage
/,
Thanks Mauliate