SlideShare a Scribd company logo
1 of 44
Download to read offline
Redux? 我覺得不⾏行行,
試試看 freestyle 的 Mobx
先問問看⼤大家來來⾃自哪個陣營
關於 ReactMaker
Hyman
前端⼯工程師,喜歡研究新的技術,也喜
歡研究有趣的UI跟效果,想要帶領更更多
的⼈人進入ReactJS的世界,最近在研究
Mobx.js!
Andy
⼀一頭栽進前端世界的⼩小⼩小⼯工程師,喜歡
玩各種前端新鮮事物。 ⽬目前專注於
ReactJS,使⽤用過Flux、Redux、Mobx
等單向資料流進⾏行行專案開發。
Giant
在團隊中擔任聯聯絡窗⼝口,⽬目前是⾼高應⼤大
碩⽣生,由於對前端開發有興趣,因此就
跟⼤大⼤大們⼀一起組成讀書會,專注於學習
ReactJs。
簡單介紹⼀一下成員
故事是這樣的
剛開始學習React的我
⼀一週後
Why?
ReactJS 特⾊色之⼀一 元件化
海海⾨門 Hyman
⽤用愛⼼心來來做事,⽤用感恩的⼼心做⼈人
<User name="海海⾨門 Hyman" desc="⽤用愛⼼心來來做事,⽤用感恩的⼼心做⼈人" src="profile.png" />
海海⾨門 Hyman
⽤用愛⼼心來來做事,⽤用感恩的⼼心做⼈人
迪倫倫 Andy
當⼿手上只有鎚⼦子,看到的東⻄西都是...
及米 Jimmy
信念念、毅⼒力力、勇氣三者具備
⼩小森 Winsome
互相瞭解是朋友,互相理理解是知⼰己
x
元件化可以幫助我們
不⽤用複製貼上
加上Virtual DOM,我只要改資料就可以⾺馬上渲染
海海⾨門 Hyman
⽤用愛⼼心來來做事,⽤用感恩的⼼心做⼈人
迪倫倫 Andy
⼈人永遠在追求快活,永遠在逃避痛苦
及米 Jimmy
信念念、毅⼒力力、勇氣三者具備
⼩小森 Winsome
互相瞭解是朋友,互相理理解是知⼰己
x
{
name: '海海⾨門 Hyman',
desc: '⽤用愛⼼心來來做事,⽤用感恩的⼼心做⼈人'
}
海海綿 Hyman
⽤用愛⼼心來來做事,⽤用感恩的⼼心做⼈人
{
name: '海海綿 Hyman',
desc: '⽤用愛⼼心來來做事,⽤用感恩的⼼心做⼈人'
}
React元件樹資料可以共享
但是不同的元件樹要共享資料有困難
??
後來來我找到了了Redux來來解
決這個問題
透過connect把Store的資料
注入到props 裡⾯面
剛開始學習Redux的我
⼀一週後
Why?
事情是這樣的,我想做⼀一個簡單的系統,
⼤大概就是 todolist 那樣的難度
然後就開始研究了了Redux資料流
恩....的確是很好的設計
等等...好像在哪裡看過
action - 聖旨
action creator - 內閣
store - 太監總管
reducer - 宣旨的太監
皇上下旨
(Button Click Event)
內閣
(action creator)
產⽣生聖旨
(action)
太監總管派發
(store)
⼩小太監宣旨
(reducer)
後來來我找到Mobx
我們先來來看⼀一下Mobx資料流
皇上下旨
(Button Click Event)
內閣
(action creator)
產⽣生聖旨
(action)
太監總管派發
(store)
⼩小太監宣旨
(reducer)
邏輯層⾯面
Redux Mobx
store, view, action
整個單向資料流
專注於store, view
狀狀態更更新
Redux Mobx
狀狀態更更新必須是Immutable 沒有特別要求
Middleware
Redux Mobx
有很多Middleware
(redux-thunk, redux-saga)
沒有Middleware
但是 mobs 有 mobx-util 可以轉換成 rxjs
Extension
Redux Mobx
有很多 也有很多
https://github.com/mobxjs/awesome-mobx#related-projects-and-utilities
總結
Redux Mobx
學習曲線較陡
結構較嚴謹
適合⼤大型專案
學習曲線平緩
較有彈性
適合中⼩小型專案
QA Time
懇請按讚
FB:ReactMaker
GH:ReactMaker
• https://segmentfault.com/a/1190000004257207
• http://renzhou.tw/yinwubrother-textmaker/
• https://noootown.gitbooks.io/deeperience-react-native-boilerplate/
content/Redux/Redux%20&%20React.html
• https://www.kirupa.com/react/transferring_properties.htm
• https://twitter.com/mweststrate/status/718444275239882753
參參考連結

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Redux? 我覺得不行, 試試看 freestyle 的 Mobx