Flux Structure & Data Flow

Data in a Flux application flows in a single direction:

  • The dispatcher, stores, and views are independent nodes with distinct inputs and outputs.
  • The actions are simple objects containing the new data and identifying type property.

The views may cause a new action to be propagated through the system in response to user interactions:


1.All data flows through the dispatcher(central hub). Actions are provided to the dispatcher in an action creator method, actions are generated from user interactions with the views.
2.The dispatcher then invokes the callbacks that the stores have registered with it,
dispatching actions to all stores.
3.stores respond to whichever actions are relevant to the state they maintain.
4.The stores then emit a change event to alert the controller-views that a change to the data layer has occurred.
5.Controller-views listen for these events and retrieve data from the stores in an event handler.
6.The controller-views call their own setState() method, causing a re-rendering of themselves
and all of their descendants in the component tree.