Notes From The Future: Beyond Flux
-
Upload
jamison-dance -
Category
Software
-
view
201 -
download
3
Transcript of Notes From The Future: Beyond Flux
NOTES FROM THE FUTURE
Beyond Flux
ABOUT ME@jergason
jergason on github jsjabber etc etc
engineer at kuali co
ABOUT YOU?
Flux"Flux eschews MVC in favor of a
unidirectional data flow. When a user interacts with a React view, the view
propagates an action through a central dispatcher, to stores that hold the
application's data and business logic, which updates all of the views that are affected."
Viewsactions
Dispatchercallback
Stores
events
controller-view event handlers
Flux
Viewsactions
Dispatchercallback
Stores
events
controller-view event handlers
FluxOK
DEMO TIME
Flux
WHAT ISTHE
FUTURE
Immutable Data
DEMO TIME
THIS IS STUPID
"Much of what makes application development difficult is tracking mutation and maintaining state. Developing with immutable data encourages you to think differently about how data flows through your application.
Subscribing to data events throughout your application, by using Object.observe, or any other mechanism, creates a huge overhead of book-keeping which can hurt performance and creates opportunities for areas of your application to get out of sync. Since immutable data never changes, subscribing to changes throughout the model is a dead-end and new data can only ever be passed from above."
THIS IS SLOW
LOL NOT SLOW
DEMO TIME
http://hypirion.com/musings/understanding-persistent-vector-pt-1
ᕕ( ᐛ )ᕗ
Lets make an app!
(•_•)
global app state
ಠ_ಠ
pass global state to all children
(つ☢益☢)つ︵┻━┻
top-level callback
CURSORS
DEMO TIME
render function
cursorscursor callback
componentscursor updates
Resourceshttps://github.com/facebook/immutable-js https://github.com/omniscientjs/immstruct https://github.com/swannodette/om https://github.com/jergason/happytrack