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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
55
I want to be a web guitar player
shiningjason1989
0
340
PikaPika
shiningjason1989
2
830
前端之今天的我,未來的我們
shiningjason1989
0
270
Progressive Web App 之是否是我的未來
shiningjason1989
4
1.5k
Flux 角色詳解
shiningjason1989
4
10k
Flux 流程詳解
shiningjason1989
2
9.7k
如何打造一個百人 stars 的 React Native 元件
shiningjason1989
1
260
前端魔法師召集令
shiningjason1989
1
250
Other Decks in Technology
See All in Technology
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
130
Meshy Proプラン課金した
henjin0
0
200
MCPでつなぐElasticsearchとLLM - 深夜の障害対応を楽にしたい / Bridging Elasticsearch and LLMs with MCP
sashimimochi
0
130
AI時代、1年目エンジニアの悩み
jin4
1
150
今日から始めるAmazon Bedrock AgentCore
har1101
4
380
Kiro IDEのドキュメントを全部読んだので地味だけどちょっと嬉しい機能を紹介する
khmoryz
0
140
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
2
1.9k
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
Agile Leadership Summit Keynote 2026
m_seki
1
210
セキュリティについて学ぶ会 / 2026 01 25 Takamatsu WordPress Meetup
rocketmartue
1
270
データの整合性を保ちたいだけなんだ
shoheimitani
6
2.3k
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
270
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
63
Embracing the Ebb and Flow
colly
88
5k
A Tale of Four Properties
chriscoyier
162
24k
Marketing to machines
jonoalderson
1
4.6k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
62
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
53
First, design no harm
axbom
PRO
2
1.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
250
The Pragmatic Product Professional
lauravandoore
37
7.1k
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