flux concepts

Concepts

  • Views
  • ActionCreators
  • Dispatcher
  • Stores

The data-flow story

  1. App initialization:
    • init dispatcher and stores
    • get data
    • render views
    • views register callbacks to stores
    • stores register callbacks to dispatcher
  2. User interaction: view calls ActionCreator with an action
  3. ActionCreator: calls Dispatcher with API data
  4. Dispatcher: send messages to all listening Stores
  5. Stores: get messages, change data, emit change event
  6. Views: respond to Store changes, query Store, re-render
  7. goto 2

Flux example chat deep-dive

On github

Links