SlideShare a Scribd company logo
Introduce 
Flux & React 
in practice 
ReactJS.tw - meetup 2 
@randylien
About Me 
• Randy Lien 
• HTML, CSS, JavaScript, Python 
• Backbone/Marionette/React 
• PC-Cillin, SafeSync 
• KKBOX 
• @randylien
Preface 
• Everything you see today is under construction. 
• This is my personal experience sharing. 
• If there are anything I mentioned is not correct, 
please feel free to point out.
Flux & React 
• Flux is an architecture 
• Dispatcher 
• There are many extensions* 
for Flux 
• One direction data flow 
• React is a library to create View 
• Component 
• JSX 
• Compiled
Flux & React 
• React is a library to create View 
• Component 
• JSX 
• Compiled 
• Flux is an architecture 
• Dispatcher 
• There are many extensions* 
for Flux 
• One direction data flow 
Data Presentation
What Is Flux
“The action or process of flowing or flowing out.” 
– Dictionary, in your Mac
Dr.Brown 
explains 
• Flux Capacitor 
• Flux = Flow of time. 
• Capacitor = Temporary 
Storage. 
• Flux Capacitor must be 
powered by a small Reactor. 
• Time space continuum is 
circular in nature. 
Ask Facecbook’s react/flhuxt ttepam:/, /wbhya cktothefuture.wikia.com/wiki/File:Flux-capacitor-back-to-the-future.jpg 
call flux & react ? 
Dose it come from Back to The Future ?
Flux & React 
• Flux just like time, it is one 
way direction to flow 
• Capacitor is Store 
• Event trigger from React 
• The flow is circular in nature 
http://www.8ball.co.uk/media/catalog/product/b/a/back_to_the_future_-_flux_capacitor_-_yel_mens_4_1.jpg
Flux is circular in nature 
http://facebook.github.io/react/img/blog/flux-diagram.png
Store 
• Kind of model 
• Callbacks will trigger Store’s internal methods 
• Update data 
• Trigger Store’s change event 
• Store will return data to React 
• React’s Virtual DOM will handle your data
Events from React 
https://www.facebook.com/photo.php?fbid=10154774642145430&set=gm.1491610957781164&type=1&theater
Important 
http://facebook.github.io/react/img/blog/flux-diagram.png
Store & React
App get data from Store 
store 
store store 
store 
app.js
Set Property to your Component 
store 
store store store 
app.js
component 
store 
store store store 
component 
component 
component 
Set Properties to your sub Components
Sub Components get properties 
comstpoorneent 
component 
component 
comstpoorneent 
store 
store
Continue to dispatch properties to sub components 
compo 
nent comp 
comp 
onent 
onent 
compo 
nent 
comp 
onent 
comp 
onent 
comp 
onent 
compo 
nent 
comp 
onent 
comp 
onent 
comp 
onent 
comp 
onent 
comp 
onent
comp 
onent 
React’s Virtual DOM will handle the value for you 
comp 
onent 
comp 
onent 
compo 
nent 
comp 
onent 
compo 
nent 
comp 
onent 
comp 
onent 
compo 
nent 
comp 
onent 
comp 
onent 
comp 
onent 
comp 
onent
Important 
http://facebook.github.io/react/img/blog/flux-diagram.png
Practices for Flux 
• Use console.log in Store 
• Data should not be changed in other place 
• Use shouldComponentUpdate wisely 
• Render correctly 
• Improve performance
Use Case 1. Music Player 
• Development time: ~4 weeks 
• Pure Flux architecture 
• 4 Stores (PlayerStore, ChannelStore, 
UserStore, AppStore) 30 
Components, 40 Constants
DEMO
Use Case 2. Mobile Store 
• Development time: ~3 weeks 
• Use Fluxxor 
• Director as Router 
• 9 Stores, 13 Components, 16 
Layouts
DEMO
Flux implementation 
• http://fluxxor.com/ 
• https://github.com/spoike/refluxjs 
• https://github.com/jmreidy/fluxy 
• https://github.com/yahoo/dispatchr 
• https://github.com/yahoo/fluxible-app 
• https://github.com/kenwheeler/mcfly 
• http://deloreanjs.com/ 
• http://www.jflux.io
“Understand the architecture before 
you leverage any implementations.” 
- Randy
By the way
f.lux
Q&A

More Related Content

What's hot

React & Flux Workshop
React & Flux WorkshopReact & Flux Workshop
React & Flux Workshop
Christian Lilley
 
React + Redux for Web Developers
React + Redux for Web DevelopersReact + Redux for Web Developers
React + Redux for Web Developers
Jamal Sinclair O'Garro
 
Akka - Developing SEDA Based Applications
Akka - Developing SEDA Based ApplicationsAkka - Developing SEDA Based Applications
Akka - Developing SEDA Based Applications
Benjamin Darfler
 
001. Introduction about React
001. Introduction about React001. Introduction about React
001. Introduction about React
Binh Quan Duc
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
Austin Garrod
 
React + Flux = Joy
React + Flux = JoyReact + Flux = Joy
React + Flux = Joy
John Need
 
React. Flux. Redux
React. Flux. ReduxReact. Flux. Redux
React. Flux. Redux
Andrey Kolodnitsky
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIMarcin Grzywaczewski
 
Tech Talk on ReactJS
Tech Talk on ReactJSTech Talk on ReactJS
Tech Talk on ReactJS
Atlogys Technical Consulting
 
Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETAlan Hecht
 
Reacting to the Isomorphic Buzz
Reacting to the Isomorphic BuzzReacting to the Isomorphic Buzz
Reacting to the Isomorphic Buzz
Bruce Coddington
 
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer ReplacementMidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
Zach Lendon
 
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Zach Lendon
 
Intro to React
Intro to ReactIntro to React
Intro to React
Jamal Sinclair O'Garro
 
Marionette talk 2016
Marionette talk 2016Marionette talk 2016
Marionette talk 2016
Kseniya Redunova
 
Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2
Mike Melusky
 
Advantages of Rails Framework
Advantages of Rails FrameworkAdvantages of Rails Framework
Advantages of Rails Framework
Sathish Mariappan
 
Embracing the Future
Embracing the FutureEmbracing the Future
Embracing the Future
Jemuel Young
 
Developing Single Page Apps with Ember.js
Developing Single Page Apps with Ember.jsDeveloping Single Page Apps with Ember.js
Developing Single Page Apps with Ember.js
Leo Hernandez
 

What's hot (20)

React & Flux Workshop
React & Flux WorkshopReact & Flux Workshop
React & Flux Workshop
 
About Flux
About FluxAbout Flux
About Flux
 
React + Redux for Web Developers
React + Redux for Web DevelopersReact + Redux for Web Developers
React + Redux for Web Developers
 
Akka - Developing SEDA Based Applications
Akka - Developing SEDA Based ApplicationsAkka - Developing SEDA Based Applications
Akka - Developing SEDA Based Applications
 
001. Introduction about React
001. Introduction about React001. Introduction about React
001. Introduction about React
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
React + Flux = Joy
React + Flux = JoyReact + Flux = Joy
React + Flux = Joy
 
React. Flux. Redux
React. Flux. ReduxReact. Flux. Redux
React. Flux. Redux
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
 
Tech Talk on ReactJS
Tech Talk on ReactJSTech Talk on ReactJS
Tech Talk on ReactJS
 
Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NET
 
Reacting to the Isomorphic Buzz
Reacting to the Isomorphic BuzzReacting to the Isomorphic Buzz
Reacting to the Isomorphic Buzz
 
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer ReplacementMidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
 
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Marionette talk 2016
Marionette talk 2016Marionette talk 2016
Marionette talk 2016
 
Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2
 
Advantages of Rails Framework
Advantages of Rails FrameworkAdvantages of Rails Framework
Advantages of Rails Framework
 
Embracing the Future
Embracing the FutureEmbracing the Future
Embracing the Future
 
Developing Single Page Apps with Ember.js
Developing Single Page Apps with Ember.jsDeveloping Single Page Apps with Ember.js
Developing Single Page Apps with Ember.js
 

Viewers also liked

React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
Nikolaus Graf
 
React, Flux and a little bit of Redux
React, Flux and a little bit of ReduxReact, Flux and a little bit of Redux
React, Flux and a little bit of Redux
Ny Fanilo Andrianjafy, B.Eng.
 
Flux: A Language for Programming High-Performance Servers
Flux: A Language for Programming High-Performance ServersFlux: A Language for Programming High-Performance Servers
Flux: A Language for Programming High-Performance Servers
Emery Berger
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
Andrew Hull
 
Welcome to React & Flux !
Welcome to React & Flux !Welcome to React & Flux !
Welcome to React & Flux !Ritesh Kumar
 
MERN Presentation, January 2015
MERN Presentation, January 2015MERN Presentation, January 2015
MERN Presentation, January 2015
Barry Dyck
 
Building Open-Source React Components
Building Open-Source React ComponentsBuilding Open-Source React Components
Building Open-Source React Components
Zack Argyle
 
"Flux — новый взгляд на старые проблемы" — Сергей Прохоров, MoscowJS 18
"Flux — новый взгляд на старые проблемы" — Сергей Прохоров, MoscowJS 18"Flux — новый взгляд на старые проблемы" — Сергей Прохоров, MoscowJS 18
"Flux — новый взгляд на старые проблемы" — Сергей Прохоров, MoscowJS 18MoscowJS
 
React Router: React Meetup XXL
React Router: React Meetup XXLReact Router: React Meetup XXL
React Router: React Meetup XXL
Rob Gietema
 
React Native Internals
React Native InternalsReact Native Internals
React Native Internals
Tadeu Zagallo
 
Intro to RxJava/RxAndroid - GDG Munich Android
Intro to RxJava/RxAndroid - GDG Munich AndroidIntro to RxJava/RxAndroid - GDG Munich Android
Intro to RxJava/RxAndroid - GDG Munich Android
Egor Andreevich
 
Android Design Principles and Popular Patterns
Android Design Principles and Popular PatternsAndroid Design Principles and Popular Patterns
Android Design Principles and Popular Patterns
Faiz Malkani
 
React.js and Flux in details
React.js and Flux in detailsReact.js and Flux in details
React.js and Flux in details
Artyom Trityak
 
Welding in Pediatric dentistry
Welding in Pediatric dentistryWelding in Pediatric dentistry
Welding in Pediatric dentistry
Dr. Deepashree Paul
 
Clean architecture on android
Clean architecture on androidClean architecture on android
Clean architecture on android
Benjamin Cheng
 
【Potatotips #26】Replace EventBus with RxJava/RxAndroid
【Potatotips #26】Replace EventBus with RxJava/RxAndroid【Potatotips #26】Replace EventBus with RxJava/RxAndroid
【Potatotips #26】Replace EventBus with RxJava/RxAndroid
Hiroyuki Kusu
 
Lightning Talk - Clean Architecture and Design
Lightning Talk - Clean Architecture and DesignLightning Talk - Clean Architecture and Design
Lightning Talk - Clean Architecture and DesignDeivison Sporteman
 

Viewers also liked (18)

React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
 
React, Flux and a little bit of Redux
React, Flux and a little bit of ReduxReact, Flux and a little bit of Redux
React, Flux and a little bit of Redux
 
Flux: A Language for Programming High-Performance Servers
Flux: A Language for Programming High-Performance ServersFlux: A Language for Programming High-Performance Servers
Flux: A Language for Programming High-Performance Servers
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
 
Welcome to React & Flux !
Welcome to React & Flux !Welcome to React & Flux !
Welcome to React & Flux !
 
MERN Presentation, January 2015
MERN Presentation, January 2015MERN Presentation, January 2015
MERN Presentation, January 2015
 
Building Open-Source React Components
Building Open-Source React ComponentsBuilding Open-Source React Components
Building Open-Source React Components
 
"Flux — новый взгляд на старые проблемы" — Сергей Прохоров, MoscowJS 18
"Flux — новый взгляд на старые проблемы" — Сергей Прохоров, MoscowJS 18"Flux — новый взгляд на старые проблемы" — Сергей Прохоров, MoscowJS 18
"Flux — новый взгляд на старые проблемы" — Сергей Прохоров, MoscowJS 18
 
React Router: React Meetup XXL
React Router: React Meetup XXLReact Router: React Meetup XXL
React Router: React Meetup XXL
 
Choice Paralysis
Choice ParalysisChoice Paralysis
Choice Paralysis
 
React Native Internals
React Native InternalsReact Native Internals
React Native Internals
 
Intro to RxJava/RxAndroid - GDG Munich Android
Intro to RxJava/RxAndroid - GDG Munich AndroidIntro to RxJava/RxAndroid - GDG Munich Android
Intro to RxJava/RxAndroid - GDG Munich Android
 
Android Design Principles and Popular Patterns
Android Design Principles and Popular PatternsAndroid Design Principles and Popular Patterns
Android Design Principles and Popular Patterns
 
React.js and Flux in details
React.js and Flux in detailsReact.js and Flux in details
React.js and Flux in details
 
Welding in Pediatric dentistry
Welding in Pediatric dentistryWelding in Pediatric dentistry
Welding in Pediatric dentistry
 
Clean architecture on android
Clean architecture on androidClean architecture on android
Clean architecture on android
 
【Potatotips #26】Replace EventBus with RxJava/RxAndroid
【Potatotips #26】Replace EventBus with RxJava/RxAndroid【Potatotips #26】Replace EventBus with RxJava/RxAndroid
【Potatotips #26】Replace EventBus with RxJava/RxAndroid
 
Lightning Talk - Clean Architecture and Design
Lightning Talk - Clean Architecture and DesignLightning Talk - Clean Architecture and Design
Lightning Talk - Clean Architecture and Design
 

Similar to Introduce flux & react in practice

Using redux
Using reduxUsing redux
Using redux
Jonas Ohlsson Aden
 
React introduction
React introductionReact introduction
React introduction
Kashyap Parmar
 
Reactive Streams
Reactive StreamsReactive Streams
Reactive Streams
Fehmi Can SAĞLAM
 
Redux Tech Talk
Redux Tech TalkRedux Tech Talk
Redux Tech Talk
Chathuranga Jayanath
 
Lecture05.pptx
Lecture05.pptxLecture05.pptx
Lecture05.pptx
MrVMNair
 
Lattice yapc-slideshare
Lattice yapc-slideshareLattice yapc-slideshare
Lattice yapc-slideshare
Gwenn Etourneau
 
Mongodb, our Swiss Army Knife Database
Mongodb, our Swiss Army Knife DatabaseMongodb, our Swiss Army Knife Database
Mongodb, our Swiss Army Knife Database
Mathieu Poumeyrol
 
貴圈真亂 React生態圈
貴圈真亂 React生態圈貴圈真亂 React生態圈
貴圈真亂 React生態圈
Ben Liu
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React Native
Mike Melusky
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
Geoff Harcourt
 
Springone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and ReactorSpringone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and Reactor
Stéphane Maldini
 
The Need For Speed - NxtGen Cambridge
The Need For Speed - NxtGen CambridgeThe Need For Speed - NxtGen Cambridge
The Need For Speed - NxtGen CambridgePhil Pursglove
 
Fact-Based Monitoring - PuppetConf 2014
Fact-Based Monitoring - PuppetConf 2014Fact-Based Monitoring - PuppetConf 2014
Fact-Based Monitoring - PuppetConf 2014
Puppet
 
Fluxible
FluxibleFluxible
Fluxible
Taylor Lovett
 
Introducing Venice
Introducing VeniceIntroducing Venice
Introducing Venice
Yan Yan
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive ui
Paul van Zyl
 
An Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemAn Intense Overview of the React Ecosystem
An Intense Overview of the React Ecosystem
Rami Sayar
 
Isomorphic JavaScript with Node, WebPack, and React
Isomorphic JavaScript with Node, WebPack, and ReactIsomorphic JavaScript with Node, WebPack, and React
Isomorphic JavaScript with Node, WebPack, and React
Tyler Peterson
 
DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an Afterthought
Nick Santamaria
 

Similar to Introduce flux & react in practice (20)

Using redux
Using reduxUsing redux
Using redux
 
React introduction
React introductionReact introduction
React introduction
 
Velocity - Edge UG
Velocity - Edge UGVelocity - Edge UG
Velocity - Edge UG
 
Reactive Streams
Reactive StreamsReactive Streams
Reactive Streams
 
Redux Tech Talk
Redux Tech TalkRedux Tech Talk
Redux Tech Talk
 
Lecture05.pptx
Lecture05.pptxLecture05.pptx
Lecture05.pptx
 
Lattice yapc-slideshare
Lattice yapc-slideshareLattice yapc-slideshare
Lattice yapc-slideshare
 
Mongodb, our Swiss Army Knife Database
Mongodb, our Swiss Army Knife DatabaseMongodb, our Swiss Army Knife Database
Mongodb, our Swiss Army Knife Database
 
貴圈真亂 React生態圈
貴圈真亂 React生態圈貴圈真亂 React生態圈
貴圈真亂 React生態圈
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React Native
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
 
Springone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and ReactorSpringone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and Reactor
 
The Need For Speed - NxtGen Cambridge
The Need For Speed - NxtGen CambridgeThe Need For Speed - NxtGen Cambridge
The Need For Speed - NxtGen Cambridge
 
Fact-Based Monitoring - PuppetConf 2014
Fact-Based Monitoring - PuppetConf 2014Fact-Based Monitoring - PuppetConf 2014
Fact-Based Monitoring - PuppetConf 2014
 
Fluxible
FluxibleFluxible
Fluxible
 
Introducing Venice
Introducing VeniceIntroducing Venice
Introducing Venice
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive ui
 
An Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemAn Intense Overview of the React Ecosystem
An Intense Overview of the React Ecosystem
 
Isomorphic JavaScript with Node, WebPack, and React
Isomorphic JavaScript with Node, WebPack, and ReactIsomorphic JavaScript with Node, WebPack, and React
Isomorphic JavaScript with Node, WebPack, and React
 
DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an Afterthought
 

More from Hsuan Fu Lien

The Ideas of Clojure - Things I learn from Clojure
The Ideas of Clojure - Things I learn from ClojureThe Ideas of Clojure - Things I learn from Clojure
The Ideas of Clojure - Things I learn from Clojure
Hsuan Fu Lien
 
Django Girls 2015 - CSS
Django Girls 2015 - CSSDjango Girls 2015 - CSS
Django Girls 2015 - CSS
Hsuan Fu Lien
 
Django Girls 2015 - HTML
Django Girls 2015 -  HTMLDjango Girls 2015 -  HTML
Django Girls 2015 - HTML
Hsuan Fu Lien
 
React.JS Conf & F8
React.JS Conf & F8React.JS Conf & F8
React.JS Conf & F8
Hsuan Fu Lien
 
Immutable, performance and components communication
Immutable, performance and components communicationImmutable, performance and components communication
Immutable, performance and components communication
Hsuan Fu Lien
 
What is the next step for a front end beginner
What is the next step for a front end beginnerWhat is the next step for a front end beginner
What is the next step for a front end beginner
Hsuan Fu Lien
 
Understand front end developer
Understand front end developerUnderstand front end developer
Understand front end developer
Hsuan Fu Lien
 
UI Engineering Introduction
UI Engineering IntroductionUI Engineering Introduction
UI Engineering Introduction
Hsuan Fu Lien
 
Using Yeoman to develop Web App
Using Yeoman to develop Web AppUsing Yeoman to develop Web App
Using Yeoman to develop Web App
Hsuan Fu Lien
 

More from Hsuan Fu Lien (9)

The Ideas of Clojure - Things I learn from Clojure
The Ideas of Clojure - Things I learn from ClojureThe Ideas of Clojure - Things I learn from Clojure
The Ideas of Clojure - Things I learn from Clojure
 
Django Girls 2015 - CSS
Django Girls 2015 - CSSDjango Girls 2015 - CSS
Django Girls 2015 - CSS
 
Django Girls 2015 - HTML
Django Girls 2015 -  HTMLDjango Girls 2015 -  HTML
Django Girls 2015 - HTML
 
React.JS Conf & F8
React.JS Conf & F8React.JS Conf & F8
React.JS Conf & F8
 
Immutable, performance and components communication
Immutable, performance and components communicationImmutable, performance and components communication
Immutable, performance and components communication
 
What is the next step for a front end beginner
What is the next step for a front end beginnerWhat is the next step for a front end beginner
What is the next step for a front end beginner
 
Understand front end developer
Understand front end developerUnderstand front end developer
Understand front end developer
 
UI Engineering Introduction
UI Engineering IntroductionUI Engineering Introduction
UI Engineering Introduction
 
Using Yeoman to develop Web App
Using Yeoman to develop Web AppUsing Yeoman to develop Web App
Using Yeoman to develop Web App
 

Recently uploaded

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 

Recently uploaded (20)

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 

Introduce flux & react in practice

  • 1. Introduce Flux & React in practice ReactJS.tw - meetup 2 @randylien
  • 2. About Me • Randy Lien • HTML, CSS, JavaScript, Python • Backbone/Marionette/React • PC-Cillin, SafeSync • KKBOX • @randylien
  • 3. Preface • Everything you see today is under construction. • This is my personal experience sharing. • If there are anything I mentioned is not correct, please feel free to point out.
  • 4. Flux & React • Flux is an architecture • Dispatcher • There are many extensions* for Flux • One direction data flow • React is a library to create View • Component • JSX • Compiled
  • 5. Flux & React • React is a library to create View • Component • JSX • Compiled • Flux is an architecture • Dispatcher • There are many extensions* for Flux • One direction data flow Data Presentation
  • 7. “The action or process of flowing or flowing out.” – Dictionary, in your Mac
  • 8. Dr.Brown explains • Flux Capacitor • Flux = Flow of time. • Capacitor = Temporary Storage. • Flux Capacitor must be powered by a small Reactor. • Time space continuum is circular in nature. Ask Facecbook’s react/flhuxt ttepam:/, /wbhya cktothefuture.wikia.com/wiki/File:Flux-capacitor-back-to-the-future.jpg call flux & react ? Dose it come from Back to The Future ?
  • 9. Flux & React • Flux just like time, it is one way direction to flow • Capacitor is Store • Event trigger from React • The flow is circular in nature http://www.8ball.co.uk/media/catalog/product/b/a/back_to_the_future_-_flux_capacitor_-_yel_mens_4_1.jpg
  • 10. Flux is circular in nature http://facebook.github.io/react/img/blog/flux-diagram.png
  • 11. Store • Kind of model • Callbacks will trigger Store’s internal methods • Update data • Trigger Store’s change event • Store will return data to React • React’s Virtual DOM will handle your data
  • 12. Events from React https://www.facebook.com/photo.php?fbid=10154774642145430&set=gm.1491610957781164&type=1&theater
  • 15. App get data from Store store store store store app.js
  • 16. Set Property to your Component store store store store app.js
  • 17. component store store store store component component component Set Properties to your sub Components
  • 18. Sub Components get properties comstpoorneent component component comstpoorneent store store
  • 19. Continue to dispatch properties to sub components compo nent comp comp onent onent compo nent comp onent comp onent comp onent compo nent comp onent comp onent comp onent comp onent comp onent
  • 20. comp onent React’s Virtual DOM will handle the value for you comp onent comp onent compo nent comp onent compo nent comp onent comp onent compo nent comp onent comp onent comp onent comp onent
  • 22. Practices for Flux • Use console.log in Store • Data should not be changed in other place • Use shouldComponentUpdate wisely • Render correctly • Improve performance
  • 23. Use Case 1. Music Player • Development time: ~4 weeks • Pure Flux architecture • 4 Stores (PlayerStore, ChannelStore, UserStore, AppStore) 30 Components, 40 Constants
  • 24. DEMO
  • 25. Use Case 2. Mobile Store • Development time: ~3 weeks • Use Fluxxor • Director as Router • 9 Stores, 13 Components, 16 Layouts
  • 26. DEMO
  • 27. Flux implementation • http://fluxxor.com/ • https://github.com/spoike/refluxjs • https://github.com/jmreidy/fluxy • https://github.com/yahoo/dispatchr • https://github.com/yahoo/fluxible-app • https://github.com/kenwheeler/mcfly • http://deloreanjs.com/ • http://www.jflux.io
  • 28. “Understand the architecture before you leverage any implementations.” - Randy
  • 30. f.lux
  • 31. Q&A