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
深入淺出 Redux
Search
shiningjason1989
July 05, 2016
Technology
2
12k
深入淺出 Redux
shiningjason1989
July 05, 2016
Tweet
Share
More Decks by shiningjason1989
See All by shiningjason1989
5 分鐘與我一起探索最佳的搜尋體驗
shiningjason1989
1
48
I want to be a web guitar player
shiningjason1989
0
280
PikaPika
shiningjason1989
2
800
前端之今天的我,未來的我們
shiningjason1989
0
260
Progressive Web App 之是否是我的未來
shiningjason1989
4
1.5k
Flux 角色詳解
shiningjason1989
4
9.6k
Flux 流程詳解
shiningjason1989
2
9.4k
如何打造一個百人 stars 的 React Native 元件
shiningjason1989
1
260
前端魔法師召集令
shiningjason1989
1
240
Other Decks in Technology
See All in Technology
RubyでKubernetesプログラミング
sat
PRO
4
160
AWS re:Invent 2024 re:Cap Taipei (for Developer): New Launches that facilitate Developer Workflow and Continuous Innovation
dwchiang
0
170
コロプラのオンボーディングを採用から語りたい
colopl
5
1.3k
Amazon Route 53, 待ちに待った TLSAレコードのサポート開始
kenichinakamura
0
170
AWS Community Builderのススメ - みんなもCommunity Builderに応募しよう! -
smt7174
0
180
0→1事業こそPMは営業すべし / pmconf #落選お披露目 / PM should do sales in zero to one
roki_n_
PRO
1
1.5k
AWSマルチアカウント統制環境のすゝめ / 20250115 Mitsutoshi Matsuo
shift_evolve
0
120
My small contributions - Fujiwara Tech Conference 2025
ijin
0
1.4k
AWSの生成AIサービス Amazon Bedrock入門!(2025年1月版)
minorun365
PRO
7
470
自社 200 記事を元に整理した読みやすいテックブログを書くための Tips 集
masakihirose
2
330
ドメイン駆動設計の実践により事業の成長スピードと保守性を両立するショッピングクーポン
lycorptech_jp
PRO
13
2.2k
Formal Development of Operating Systems in Rust
riru
1
420
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
19
2.3k
Six Lessons from altMBA
skipperchong
27
3.6k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
240
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
Typedesign – Prime Four
hannesfritz
40
2.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
Transcript
3FEVY
'MVY 䱳鎣3FEVY⯓㔐곃
Dispatcher Stores Views Action Action
㻜♳䧮⦛剚呏亙♶ず噠䬓ⴕ4UPSF Dispatcher Store Views Action Action Store Store
㻜♳䧮⦛剚呏亙♶ず噠䬓ⴕ4UPSF ⢿㥶5PEP4UPSF 6TFS4UPSF Dispatcher Store Views Action Action TodoStore UserStore
齡랃⡹鼩鎹䖤4UPSF⨞✫ㆭ❉✲䞕㌨ Dispatcher Store Views Action Action Store Store
4UPSF剤Ⰽ⦐⚺銴耷顑 Store
4UPSF剤Ⰽ⦐⚺銴耷顑 ⮭㶸须俲朜䢀 Store let state = 0
4UPSF剤Ⰽ⦐⚺銴耷顑 ⮭㶸须俲朜䢀 呏亙"DUJPO佖隶须俲朜䢀 Store let state = 0 function change(action)
{ state = action.data }
⢪欽'MVY剚麂ⵌ涸 ㉏겗
殹䧮⦛⥜佖 Store state: 10 let state = 0 function change(action)
{ state = action.data }
殹䧮⦛⥜佖呏亙"DUJPO佖隶朜䢀涸齅鱀 Store state: 10 let state = 0 function change(action)
{ state = action.data + 1 }
殹䧮⦛⥜佖呏亙"DUJPO佖隶朜䢀涸齅鱀 㔔捀侮佅4UPSF刿倞✫须俲朜䢀⛳剚ꅾ縨 Store state: 0 let state = 0 function
change(action) { state = action.data + 1 }
⡹〳⟃䟝⫹殹⡹佖㸤♧⦐CVH Store user: Jason
⡹〳⟃䟝⫹殹⡹佖㸤♧⦐CVH 捀✫庠鑑㽠䗳갭ⱄ駵♧妄鏽ⱁ崩玑涸汥蕲㌨ Store user: null
鍑对 㥶⡦
⡹剤涮植鸏ꡠ꒳㉏겗僽➊랃㌨ Store let state = 0 function change(action) { state
= action.data }
4UPSF剤Ⰽ⦐⚺銴耷顑 ⮭㶸朜䢀 呏亙"DUJPO佖隶朜䢀 Store let state = 0 function change(action)
{ state = action.data }
4UPSF剤Ⰽ⦐⚺銴耷顑 䧮⦛䗳갭䪾㸐⦛䬓雊㸐⦛♶剚✽湱䕧갠 Store let state = 0 function change(action) {
state = action.data }
&MN ㉬涮倴
㖈&MNBSDIJUFDUVSF⚥刿倞.PEFM涸倰䒭僽 (msg, model) => model'
㖈&MNBSDIJUFDUVSF⚥刿倞.PEFM涸倰䒭僽 (msg, model) => model' 缺䧭涯鑨俒㽠僽 (ᤈ傶, 制眲) => 碝制眲
㖈&MNBSDIJUFDUVSF⚥刿倞.PEFM涸倰䒭僽 (msg, model) => model' 缺䧭涯鑨俒㽠僽 (ᤈ傶, 制眲) => 碝制眲
ⱄ涯♧럊㽠僽 蝚螂Ӟ㮆獢碍牧妔Ԩᤈ傶制眲牧ࢧ㯽碝制眲
䨾⟃䧮⦛䪾呏亙"DUJPO佖隶朜䢀涸齅鱀 㹁纏䧭♧⦐ⴅ侸 (action, state) => state'
䨾⟃䧮⦛䪾呏亙"DUJPO佖隶朜䢀涸齅鱀 㹁纏䧭♧⦐ⴅ侸 (action, state) => state' 䧮⦛〭鸏♧⦐ⴅ侸捀SFEVDFS
3FEVDFS 3FEVY剓呍䗱涸錚䙂
(action, state) => state' 3FEVDFS涸㥪贖僽 〳갸劍殹侸窍✮♧垺涸㔐⫄穡卓㽠剚♧垺
(action, state) => state' 3FEVDFS涸㥪贖僽 〳갸劍殹侸窍✮♧垺涸㔐⫄穡卓㽠剚♧垺 ⴅ侸管玑㸐㽠〫僽♧⦐矦㋲涸ⴅ侸
(action, state) => state' 3FEVDFS涸㥪贖僽 〳갸劍殹侸窍✮♧垺涸㔐⫄穡卓㽠剚♧垺 ⴅ侸管玑㸐㽠〫僽♧⦐矦㋲涸ⴅ侸 〳⟃殹⡲侸⫄黃䧴罏乩剤Ⱖ➮ⴅ侸管玑涸⮛럊
(action, state) => state' 3FEVDFS涸㥪贖僽 〳갸劍殹侸窍✮♧垺涸㔐⫄穡卓㽠剚♧垺 ⴅ侸管玑㸐㽠〫僽♧⦐矦㋲涸ⴅ侸 〳⟃殹⡲侸⫄黃䧴罏乩剤Ⱖ➮ⴅ侸管玑涸⮛럊 〳⟃⨞ⵌVOEPSFEP涸⸆腋
(action, state) => state' 3FEVDFS涸㥪贖僽 〳갸劍殹侸窍✮♧垺涸㔐⫄穡卓㽠剚♧垺 ⴅ侸管玑㸐㽠〫僽♧⦐矦㋲涸ⴅ侸 〳⟃殹⡲侸⫄黃䧴罏乩剤Ⱖ➮ⴅ侸管玑涸⮛럊 〳⟃⨞ⵌVOEPSFEP涸⸆腋
〳⟃⟤䠑佖隶锅欽ⴅ侸涸갫䎸
3FEVY 涸䧭䕎
㥶卓䧮⦛锅侮4UPSF鸏⦐錬蒀 Dispatcher Store Views Action Action Store Store
㥶卓䧮⦛锅侮4UPSF鸏⦐錬蒀 㼟嫦⦐4UPSF涸噠朜䢀̔ Store Store Store ̔
Store Store Store Store ̔ state subState subState subState 㥶卓䧮⦛锅侮4UPSF鸏⦐錬蒀
㼟嫦⦐4UPSF涸噠朜䢀̔穉䧭♧⦐朜䢀埠
㥶卓䧮⦛锅侮4UPSF鸏⦐錬蒀 㼟嫦⦐4UPSF涸噠朜䢀̔穉䧭♧⦐朜䢀埠 Store ̔ state auth todo user AuthStore TodoStore
UserStore
㥶卓䧮⦛锅侮4UPSF鸏⦐錬蒀 㼟嫦⦐4UPSF涸噠朜䢀̔穉䧭♧⦐朜䢀埠 㼟嫦⦐4UPSF佖隶朜䢀涸齅鱀 Store Store Store ̔ Store state subState
subState subState
㥶卓䧮⦛锅侮4UPSF鸏⦐錬蒀 㼟嫦⦐4UPSF涸噠朜䢀̔穉䧭♧⦐朜䢀埠 㼟嫦⦐4UPSF佖隶朜䢀涸齅鱀̔㼩䥰䧭嫦⦐3FEVDFS Store Store Store ̔ Store state subState
subState subState Store Store Reducer
Store ̔ state auth todo user AuthStore TodoStore UserStore 㥶卓䧮⦛锅侮4UPSF鸏⦐錬蒀
㼟嫦⦐4UPSF涸噠朜䢀̔穉䧭♧⦐朜䢀埠 㼟嫦⦐4UPSF佖隶朜䢀涸齅鱀̔㼩䥰䧭嫦⦐3FEVDFS reducer todoReducer userReducer authReducer
䨾⟃㥶卓㼟'MVY涸4UPSFT Dispatcher Store Views Action Action Store Store
䨾⟃㥶卓㼟'MVY涸4UPSFT 剐䳖䧭4UPSFㄤ3FEVDFST Dispatcher Store Views Action Action Store Store Reducer
state
㔔捀侮⦐䥰欽〫剤♧⦐4UPSF Dispatcher Store Views Action Action Store Store Reducer state
㔔捀侮⦐䥰欽〫剤♧⦐4UPSF 䧮⦛♶ⱄ銴%JTQBUDIFS Store Views Action Action Store Store Reducer state
罜鷴麕4UPSF䲿⣘涸"1* ⫄黃BDUJPO暟⟝ Store Views Action Action Store Store Reducer state
鸏㽠僽3FEVY Store Views Action Action Reducers