Flux
Application architecture for building user interfaces
Pattern
Framework
"Flux eschews MVC in favor of a unidirectional data flow."
// from flux website
"Flux eschews MVC in favor of a unidirectional data flow."
Actions
created by Views
will cause Store to update
Change 'read' book in Books to 'true'
{title: 'Professional Node.js', read: false}
Dispatcher
central hub
handles actions
invokes store callbacks
Select the Store resposible to handle the action
Stores
have application data
have application state
register a callback with the dispatcher
emit a change event
Change the state of 'read'
from 'false' to 'true'
Views
consume data
may retain some state
can trigger Actions
View is notified by Store,
render() is called,
view is updated with the book (read=true)
There are several implementations of Flux
Redux
Fluxible
Alt
....
Resources