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
iPlaygourd 2024
haifengkao
0
2
模組化的Swift架構(二) DDD速成
haifengkao
0
770
日常生活中的腦殘
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
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
350
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
430
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
210
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.7k
破壊せよ!データ破壊駆動で考えるドメインモデリング / data-destroy-driven
minodriven
17
4.3k
RubyLSPのマルチバイト文字対応
notfounds
0
100
Tuning GraphQL on Rails
pyama86
2
1.2k
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
320
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
490
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
240
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
140
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
133
8.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
7
570
Optimising Largest Contentful Paint
csswizardry
33
2.9k
The Invisible Side of Design
smashingmag
297
50k
Rails Girls Zürich Keynote
gr2m
93
13k
Code Reviewing Like a Champion
maltzj
520
39k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Gamification - CAS2011
davidbonilla
80
5k
A better future with KSS
kneath
238
17k
GitHub's CSS Performance
jonrohan
1030
460k
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)