mapActionToState method

Stream<T> mapActionToState (
  1. T state,
  2. Action action,
  3. Store store
)

This method should be invoked by sysytem passing current state and action. You should mutate the state based on action

Example

  Stream<CounterModel> mapActionToState(
    CounterModel state, Action action ) async* {
    switch (action.type) {
      case ActionTypes.Inc:
        yield increment(state, action);
        break;
      default: yield state;
    }
  }

Implementation

Stream<T> mapActionToState(T state, Action action, Store store);