With Flux architecture the flow is unidirectional, which ultimately means that views will never update the store directly. The store provides state to your views. If you are trying to add, remove, update, or delete data from your views, you would trigger an action which would be dispatched to your stores. Your stores then would receive the data being dispatched, do something with that data and emit a 'change' event. All views subscribed to the store will be notified an updated accordingly. For example this is a view.
var Events = React.createClass({
getInitialState: function() {
this.store = this.props.context.getStore('EventStore');
return this.store.getState();
},
componentDidMount: function() {
this.store.addChangeListener(this._setState);
},
componentWillUnmount: function () {
this.store.removeListener('change', this._setState);
},
_setState: function () {
this.setState(this.store.getState());
}
});
You can follow this tutorial (http://facebook.github.io/flux/docs/todo-list.html) to get a better understanding, but the key and the immediate benefit to using an architecture like FLUX is the unidirectional flow.