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
基于Redux的模块化设计
Search
JSConf China
October 20, 2019
Programming
0
29
基于Redux的模块化设计
Chinese version
For JSConf China 2019
By 林长青
JSConf China
October 20, 2019
Tweet
Share
More Decks by JSConf China
See All by JSConf China
Redux Based Modular Design
jsconfchina
0
20
Builing (Progressive) Web Apps
jsconfchina
0
23
Other Decks in Programming
See All in Programming
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
800
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
310
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
740
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
120
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
200
AI巻き込み型コードレビューのススメ
nealle
2
1.4k
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
660
CSC307 Lecture 10
javiergs
PRO
1
660
CSC307 Lecture 01
javiergs
PRO
0
690
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
300
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
230
Data-Centric Kaggle
isax1015
2
780
Featured
See All Featured
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
160
Building the Perfect Custom Keyboard
takai
2
690
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Embracing the Ebb and Flow
colly
88
5k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
67
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
53
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
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.