Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
基于Redux的模块化设计
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
JSConf China
October 20, 2019
Programming
32
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
基于Redux的模块化设计
Chinese version
For JSConf China 2019
By 林长青
JSConf China
October 20, 2019
More Decks by JSConf China
See All by JSConf China
Redux Based Modular Design
jsconfchina
0
23
Builing (Progressive) Web Apps
jsconfchina
0
25
Other Decks in Programming
See All in Programming
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
430
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
800
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
300
Railsバージョンを4倍にした話
optim
0
450
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
ジョジョの世界をXRで再現する
mofurune
0
170
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
350
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
Kotlinの15年とServer-Side Kotlin
n_takehata
1
150
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
260
Event is what happens
moro
2
860
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
22k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
530
The browser strikes back
jonoalderson
0
1.8k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Embracing the Ebb and Flow
colly
88
5.2k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
600
The World Runs on Bad Software
bkeepers
PRO
72
12k
Practical Orchestrator
shlominoach
192
12k
The Pragmatic Product Professional
lauravandoore
37
7.5k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Transcript
基于Redux的模块化 设计 Michael Lin 林长青
2 | © 2019 RingCentral, Inc. All rights reserved. 动机
01 解决方案 03 Redux 缺点 02 Demo 04
3 | © 2019 RingCentral, Inc. All rights reserved. 如何构建基于Redux
大型应用?
4 | © 2019 RingCentral, Inc. All rights reserved. 构建大型应用
模块化 UI 组件 ?
5 | © 2019 RingCentral, Inc. All rights reserved. •
Redux 样板代码 Combine Reducers Middleware Connector Action Type
6 | © 2019 RingCentral, Inc. All rights reserved. 模块化
难点 核心业务逻辑与UI分离 模块化状态管理 优点 协作 分治 持续交付和产品迭代 更完整的自动化测试 模块化封装
7 | © 2019 RingCentral, Inc. All rights reserved. 为基于
Redux 的 中大型 React 应 用提供更好的模 块化设计模型。 动机和目标
8 | © 2019 RingCentral, Inc. All rights reserved. Redux
缺点
9 | © 2019 RingCentral, Inc. All rights reserved. Redux
缺点 松散, 难以模块化 模块化 繁琐的更新操作 不可变数据* 样板代码 不够简洁
10 | © 2019 RingCentral, Inc. All rights reserved. 解决方案
usm-redux
11 | © 2019 RingCentral, Inc. All rights reserved. Reducer
@state 装饰器
12 | © 2019 RingCentral, Inc. All rights reserved. Action
Type @action 装饰器
13 | © 2019 RingCentral, Inc. All rights reserved. Dispatch
调用Action函数
14 | © 2019 RingCentral, Inc. All rights reserved. 模块依赖
模块注入 可定制的 IoC
15 | © 2019 RingCentral, Inc. All rights reserved. 不可变数据更新
usm-redux 基于 immer 突变更新不可变数据的类库
16 | © 2019 RingCentral, Inc. All rights reserved. 好处
C 便利 更简单地更新不 可变数据 O OOP 简洁的模块化 与面向对象 O 可选 可选的生命周期 与可定制的IoC L 继承 拥抱Redux生态与 保持Redux原则
17 | © 2019 RingCentral, Inc. All rights reserved. https://github.com/unadlib/usm#quick-start-for-react
18 | © 2019 RingCentral, Inc. All rights reserved. Universal
State Module 更多信息 https://github.com/unadlib/usm
19 | © 2019 RingCentral, Inc. All rights reserved. THANKS.