mapActionToState method

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

This function should be invoked whenever action dispatchd to the store.

Example

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

Implementation

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