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
Ducksで始める!辛くないReact Redux生活 / Let's start non-p...
Search
Tadao Iseki
April 26, 2019
Programming
0
420
Ducksで始める!辛くないReact Redux生活 / Let's start non-painful React Redux Life with Ducks!
Tadao Iseki
April 26, 2019
Tweet
Share
More Decks by Tadao Iseki
See All by Tadao Iseki
CLIP STUDIO のファイルを解析して JavaScript から読めるライブラリを作った / I made a JavaScript library to read .clip file
saitoeku3
0
580
VTuber の LOD をみんなで作るための取り組み / Initiatives for an environment where anyone can contribute to vlueprint
saitoeku3
3
550
GatsbyJS と Contentful を用いた静的 Web サイト運用のすゝめ / Introduction of static web site operation with GatsbyJS and Contentful
saitoeku3
1
1.1k
なぜ人類はインタプリタを自作するのか / Why do we create a interpreter
saitoeku3
1
190
Other Decks in Programming
See All in Programming
ヤプリ新卒SREの オンボーディング
masaki12
0
130
CSC509 Lecture 13
javiergs
PRO
0
110
役立つログに取り組もう
irof
28
9.6k
みんなでプロポーザルを書いてみた
yuriko1211
0
280
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
Better Code Design in PHP
afilina
PRO
0
130
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
970
Jakarta EE meets AI
ivargrimstad
0
220
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
200
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
What's in a price? How to price your products and services
michaelherold
243
12k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Docker and Python
trallard
40
3.1k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
100
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Writing Fast Ruby
sferik
627
61k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Transcript
4NBSUQIPOF"QQ1SPKFDU3FBDUษڧձBU,*5 '.Ҫؔఓ࿕!TBJUPFLV %VDLTͰ࢝ΊΔʂ ਏ͘ͳ͍3FBDU3FEVYੜ׆
Ҫؔఓ࿕5BEBP*4&,* גࣜձࣾ$JS,JUΠϯλʔϯ !TBJUPFLV ۚۀେֶϝσΟΞใֶՊ
ࠓ͢͜ͱ 3FEVYͷ͓͞Β͍ 3FBDU3FEVYͷ͠͞ %VDLTͱ
ࠓ͞ͳ͍͜ͱ ঢ়ଶཧͷඞཁੑ .JEEMFXBSFʹ͍ͭͯ 5ZQF4DSJQUͷಋೖ
3FEVYͷ͓͞Β͍
JavaScriptͷΞϓϦέʔγϣϯͰ ঢ়ଶཧΛ͢ΔͨΊͷϥΠϒϥϦ
Component Reducer Store State Action State State Action Event Dispatch
͜Ε͕ͻͱͰ͔Δਓ✋
Θ͔Γ·ͤΜͰͨ͠
؆୯ͳΧϯλʔΞϓϦͰ ͓͞Β͍͠·͠ΐ͏ʂ IUUQTHJUIVCDPNTBJUPFLVSFBDUSFEVYTBNQMF
Component Reducer Store State Action State State Action Event Dispatch
PO$MJDLͰΠϕϯτൃՐ
Component Reducer Store State Action State State Action Event Dispatch
"DUJPO%JTQBUDI "DUJPO UZQFΛ࣋ͭΦϒδΣΫτ %JTQBUDI "DUJPOΛ4UPSFʹΘͨ͢ "DUJPO$SFBUPS "DUJPOΛฦؔ͢
Component State Action Event Dispatch Reducer Store State Action State
3FEVDFS 4UBUFͱ"DUJPOΛड͚औͬͯ ߋ৽͞Εͨ4UBUFΛฦؔ͢
Component Reducer Store State Action State State Action Event Dispatch
4UPSF 3FEVDFSΛͱʹ 4UPSFΛੜ 1SPWJEFSʹ͢͜ͱͰ ༗ޮԽ
$POUBJOFS 4UBUFͱ%JTQBUDIΛ$PNQPOFOUʹ͢
3FBDU3FEVYͷ͠͞
Component Reducer Store State Action State State Action Event Dispatch
ϑϩʔ͕ෳࡶ ʢࠓͷղઆͰղܾͨͭ͠Γʣ
IUUQTHJUIVCDPN4NBSU1IPOF"QQT1SPKFDU#PPL4FFLFS
σΟϨΫτϦߏ͕ෳࡶ
ͬͱγϯϓϧʹ͍ͨ͠ΑͶ
IUUQTHJUIVCDPNFSJLSBTEVDLTNPEVMBSSFEVY
%VDLTͱ
֤σΟϨΫτϦʹࢄ͍ͯ͠Δ ActionTypes / Action / Reducer Λ1ͭͷmoduleʹ·ͱΊΔͨΊͷϧʔϧ
- ReducerΛdefault export͢Δ - ActionCreatorΛexport͢Δ - ActionTypeɹɹɹɹɹɹɹ ɹ app-name/reducer/ACTION_TYPEʹ͢Δ ඞਢͷϧʔϧ
4UBUF "DUJPO5ZQFT "DUJPO$SFBUPST 3FEVDFS
None
γϯϓϧ✨
·ͱΊ 3FEVYͭΒΈ͕ଟ͍ %VDLTʹ͍͔ͭ͘ϧʔϧ͕͋Δ %VDLTͰγϯϓϧʹӡ༻Մೳ
Α͍React ReduxϥΠϑΛʂ