Notes From The Future: Beyond Flux

32
NOTES FROM THE FUTURE Beyond Flux

Transcript of Notes From The Future: Beyond Flux

Page 1: Notes From The Future: Beyond Flux

NOTES FROM THE FUTURE

Beyond Flux

Page 2: Notes From The Future: Beyond Flux

ABOUT ME@jergason

jergason on github jsjabber etc etc

engineer at kuali co

Page 3: Notes From The Future: Beyond Flux
Page 4: Notes From The Future: Beyond Flux
Page 5: Notes From The Future: Beyond Flux

ABOUT YOU?

Page 6: Notes From The Future: Beyond Flux

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."

Page 7: Notes From The Future: Beyond Flux

Viewsactions

Dispatchercallback

Stores

events

controller-view event handlers

Flux

Page 8: Notes From The Future: Beyond Flux

Viewsactions

Dispatchercallback

Stores

events

controller-view event handlers

FluxOK

Page 9: Notes From The Future: Beyond Flux

DEMO TIME

Page 10: Notes From The Future: Beyond Flux
Page 11: Notes From The Future: Beyond Flux
Page 12: Notes From The Future: Beyond Flux
Page 13: Notes From The Future: Beyond Flux

Flux

Page 14: Notes From The Future: Beyond Flux
Page 15: Notes From The Future: Beyond Flux

WHAT ISTHE

FUTURE

Page 16: Notes From The Future: Beyond Flux
Page 17: Notes From The Future: Beyond Flux

Immutable Data

Page 18: Notes From The Future: Beyond Flux

DEMO TIME

Page 19: Notes From The Future: Beyond Flux

THIS IS STUPID

Page 20: Notes From The Future: Beyond Flux

"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."

Page 21: Notes From The Future: Beyond Flux

THIS IS SLOW

Page 22: Notes From The Future: Beyond Flux

LOL NOT SLOW

Page 23: Notes From The Future: Beyond Flux

DEMO TIME

Page 24: Notes From The Future: Beyond Flux

http://hypirion.com/musings/understanding-persistent-vector-pt-1

Page 25: Notes From The Future: Beyond Flux

ᕕ( ᐛ )ᕗ

Lets make an app!

Page 26: Notes From The Future: Beyond Flux

(•_•)

global app state

Page 27: Notes From The Future: Beyond Flux

ಠ_ಠ

pass global state to all children

Page 28: Notes From The Future: Beyond Flux

(つ☢益☢)つ︵┻━┻

top-level callback

Page 29: Notes From The Future: Beyond Flux

CURSORS

Page 30: Notes From The Future: Beyond Flux

DEMO TIME

Page 31: Notes From The Future: Beyond Flux

render function

cursorscursor callback

componentscursor updates

Page 32: Notes From The Future: Beyond Flux

Resourceshttps://github.com/facebook/immutable-js https://github.com/omniscientjs/immstruct https://github.com/swannodette/om https://github.com/jergason/happytrack