A quick and basic demo of the flow of data through redux and react
Installation instructions:
$ git clone https://github.com/edgarfinn/redux-data-flow-demo.git
$ cd redux-data-flow-demo
$ npm install
$ npm start
Action data flow:
-
A user event / interaction triggers an action creator, passing in any relevant information pertaining to the action occurring.
-
The action creator then creates an action object, with type key describing the type of action occurring, plus an optional payload providing further context.
-
The action object is dispatched to any middleware, plus all reducers.
-
Each reducer either responds to the action with an updated piece of state, or returns the current state unchanged, depending on whether that reducer cares about the state.
-
All state is merged into a new state object which is redistributed to all containers, causing them to re-render along with any child components to re-render also.