flux concepts
Concepts
- Views
- ActionCreators
- Dispatcher
- Stores
The data-flow story
-
App initialization:
- init dispatcher and stores
- get data
- render views
- views register callbacks to stores
- stores register callbacks to dispatcher
- User interaction: view calls ActionCreator with an action
- ActionCreator: calls Dispatcher with API data
- Dispatcher: send messages to all listening Stores
- Stores: get messages, change data, emit change event
- Views: respond to Store changes, query Store, re-render
- goto 2