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
模組化的Swift架構(一) Redux入門
Search
Hai Feng Kao
June 23, 2022
Programming
0
120
模組化的Swift架構(一) Redux入門
2022/3/15 ios@Taipei分享
介紹SwiftRex
Hai Feng Kao
June 23, 2022
Tweet
Share
More Decks by Hai Feng Kao
See All by Hai Feng Kao
模組化的Swift架構(二) DDD速成
haifengkao
0
700
日常生活中的腦殘
haifengkao
0
260
機器學習超入門
haifengkao
0
160
UICollectionView自動布局
haifengkao
1
420
宅宅設計入門2
haifengkao
2
240
宅宅設計入門
haifengkao
5
290
Other Decks in Programming
See All in Programming
品質が高いコードって何?Rev2.1
ickx
1
490
どうしてこうなった命名集 ~🔥編~ / OOC 2024 LT
pictiny
4
2.8k
SwiftUI, Jetpack Composeの導入で変化した「家族アルバム みてね」のアプリ開発体験
hicka04
6
400
LPIXEL×CADDi_kaerururu
kaerururu
3
300
オブジェクト指向コードレビューの新しいアプローチ
akkie76
3
1.5k
イベントストーミングによるオブジェクトモデリング・オブジェクト指向プログラミングの適用・開発プロセスの変遷・アーキテクチャの変革 / Object modeling with Event Storming.
nrslib
12
3k
15分間でふんわり理解するDocker @ Matsuriba MAX
ukwhatn
PRO
1
340
CSRF対策のやり方、そろそろアップデートしませんか / Update your knowledge of CSRF protection
hiro_y
25
14k
PHP 8.3で追加されたjson_validate()を徹底的に深掘りしてみよう
mashirou1234
1
720
デザインシステムで Tailwind CSSとCSS in JSに分散投資をしたら良かった話
fsubal
14
3.2k
App Router への移行は「改善」となり得るのか?/ Can migration to App Router be an improvement
takefumiyoshii
1
120
Ruby製社内ツールのGo移行
bgpat
2
260
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
240
1.2M
What's in a price? How to price your products and services
michaelherold
236
11k
Raft: Consensus for Rubyists
vanstee
130
6.2k
Building Applications with DynamoDB
mza
88
5.6k
Atom: Resistance is Futile
akmur
258
25k
A Modern Web Designer's Workflow
chriscoyier
689
190k
From Idea to $5000 a Month in 5 Months
shpigford
376
45k
Done Done
chrislema
178
15k
Designing Experiences People Love
moore
135
23k
Documentation Writing (for coders)
carmenintech
59
3.8k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
657
120k
Fireside Chat
paigeccino
19
2.6k
Transcript
Redux入⾨ Hai Feng Kao 模組化的Swift架構(⼀)
None
Action0 State0 Action1 State1 Action2 State2
None
Redux • Single source of truth • Read-only state •
New state is created by pure function
Swift的Redux框架 • ReSwift • swift-composable-architecture • SwiftRex
None
Redux的優點 • Debug容易 • AOP簡單 • 和SwiftUI契合度⾼
Redux缺點 • 同功能的程序碼散落各處 • 處理side e ff ect⿇煩 • Async
operation • External state management
µFeatures Architecture • A µFeature contains • Example target •
Test target • Framework target
None
µFeatures + Redux • A µFeature’s framework target contains •
Actions • States • Reducers • Middlewares
Demo
Redux的缺點 • 當新增⼀個µFeature • 把µFeature的reducer加入reducer list • 把µFeature的middleware加入middleware list •
把µFeature的state加入global state • 處理reducer、middleware、state的投影(projection)