WhatToCook is a simple sample app to experiment with a simplified version of Flux architecture.
Instead of having one central store, we have a hierarchy of stores:
Each store comprises:
- a reducer method
- a side-effects handler method
- an immutable state object
- an environment object that carry dependencies around.
Navigator, the object that is responsible for handling navigation is one example of dependencies we have. Each store has a custom navigator tailored based on where user can navigate to from the part of the app the store is representing. Each store is in charge of creating its child store.
The sequence diagram is quite simple:
- The store received an event (Action) from somewhere (doesn't matter from where)
- The store passes the event along with the current state to the reducer
- The reducer returns a new state, plus side-effect if there is any
- The store asks side-effect handler to handle each side-effect
- The store call
on(chage:)method to notify the subscriber that state has changed







