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
150
模組化的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
物件導向的文藝復興:用DCI重塑程式設計的藝術
haifengkao
0
150
模組化的Swift架構(二) DDD速成
haifengkao
0
890
日常生活中的腦殘
haifengkao
0
280
機器學習超入門
haifengkao
0
180
UICollectionView自動布局
haifengkao
1
460
宅宅設計入門2
haifengkao
2
300
宅宅設計入門
haifengkao
5
320
Other Decks in Programming
See All in Programming
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
360
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
360
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
590
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
200
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
2
390
Angular-Apps smarter machen mit Gen AI: Lokal und offlinefähig - Hands-on Workshop!
christianliebel
PRO
0
120
AHC061解説
shun_pi
0
380
Windows on Ryzen and I
seosoft
0
300
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
220
TipKitTips
ktcryomm
0
170
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
290
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.3k
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Practical Orchestrator
shlominoach
191
11k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.5k
We Are The Robots
honzajavorek
0
200
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
340
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
640
Automating Front-end Workflow
addyosmani
1370
200k
How to Talk to Developers About Accessibility
jct
2
150
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
770
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)