Skip to content

Instantly share code, notes, and snippets.

@natevenn
Last active June 3, 2016 20:01
Show Gist options
  • Save natevenn/e0e435ff85a2f563e2d58fcb53a8d867 to your computer and use it in GitHub Desktop.
Save natevenn/e0e435ff85a2f563e2d58fcb53a8d867 to your computer and use it in GitHub Desktop.
What is Flux?
- action, dispatch(controller), store(data layer), view(view can pass an action back to the dispatcher)
- action creators are like the methods and helpers for the dispatcher
- dispatcher makes sure there are no cascading effects or i.e. one action in the store at a time
- store is where the logic is done and manipulates state then passes down to child in the view
- show a image of a flux diagram
- Its a pattern not a framework
- maybe examples of common implementations of the pattern (redux)
Why Flux?
- compare and contrast the MVC model
- trying to avoid cascading effects by preventing nested updates(what does this mean?)
- allow data layer to finish processing before triggering any additional actions
- this flows data only in one direction ( action -> store -> view -> action -> store -> view...)
- keep state close to the logic that updates that state
when to implement flux?
- useful on small and/or large projects?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment