flux
TRANSCRIPT
Flux…a Pattern
Prologue
“Sometimes you gotta go back to actually move forward.”
-Matthew McConaughey
A long time ago in a PARC far, far away….
SMALLTALK-80
History
Fast Forward
Rails
Cocoa
Client-side MV* JavaScript Frameworks
The Good Parts
Familiarity
They Makes (Some) Things Simple
Dynamic User Experience
The Not So Good Parts
Lack of Consensus
Much Fowler
So Insightwow
Very Martin
how enterprise
Complex Models
Data Binding Solutions
Framework Support
Compatibility
Templating
Enough Complaining…
What the Flux?
Unidirectional Data Flow
Conceptual Integrity“a system must have a powerful metaphor that is uniformly applied throughout a system“ – Alan
Kay
Move Fast With Stable Infrastructure
Reliability
The Pieces
Views
React Components
Maintain UI State
Respond to changes in Stores
Render data, respond to interaction
Controller-Views
Stores
Maintain Application State
Each Store manages a particular domain within the app
Similar to Models, but manage many objects
Emit change events
Actions
Can be anything that changes the state of your data
User generated events
Server events
Real time updates
Error Handling
Dispatcher
Key to unidirectional data flow
Central Hub/Callback Registry
Manages dependencies between StoreswaitFor(ids)
Keeps State in Stores, closer to the logic that updates that State
The Pattern
Dispatcher
Profile Controller-
ViewProfile Store
Notification Store
Chat Store
Prefs
Pic
Notification Controller-
View
ChatController-
View
Server New Message Action
Pic Changed Action
Action Dispatcher ViewStore
Action
Server
Code
Other Implementations
McFly
Fluxxor
Reflux
Resources
Bill Fisher
Flux GitHub
Chat Tutorial
Flux Overview (with Video)
Presentation Resources
Model View Controller: History, Theory and Usage
MVC: Xerox PARC 1978-79
Model View Controller History
Questions?
How do we convince people that in programming simplicity and clarity —in short: what mathematicians call "elegance"— are not a dispensable luxury, but a crucial matter that decides between success and failure?
Edsger Dijkstra