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
130
模組化的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
63
模組化的Swift架構(二) DDD速成
haifengkao
0
790
日常生活中的腦殘
haifengkao
0
270
機器學習超入門
haifengkao
0
170
UICollectionView自動布局
haifengkao
1
440
宅宅設計入門2
haifengkao
2
280
宅宅設計入門
haifengkao
5
310
Other Decks in Programming
See All in Programming
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
1
140
AWS Lambda functions with C# 用の Dev Container Template を作ってみた件
mappie_kochi
0
240
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
7
2.5k
ファインディの テックブログ爆誕までの軌跡
starfish719
2
1.1k
Immutable ActiveRecord
megane42
0
130
DROBEの生成AI活用事例 with AWS
ippey
0
130
GitHub Actions × RAGでコードレビューの検証の結果
sho_000
0
240
社内フレームワークとその依存性解決 / in-house framework and its dependency management
vvakame
1
550
Grafana Cloudとソラカメ
devoc
0
140
最近のVS Codeで気になるニュース 2025/01
74th
1
250
Rails アプリ地図考 Flush Cut
makicamel
1
110
Grafana Loki によるサーバログのコスト削減
mot_techtalk
1
110
Featured
See All Featured
Being A Developer After 40
akosma
89
590k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
GitHub's CSS Performance
jonrohan
1030
460k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
31
2.1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Adopting Sorbet at Scale
ufuk
74
9.2k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
240
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
50k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
29
4.6k
How STYLIGHT went responsive
nonsquared
98
5.3k
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)