reducer function

int reducer(
  1. int previousState,
  2. dynamic action
)

Implementation

int reducer(int previousState, dynamic action) {
  if (action == ActionsStore.increment) {
    return previousState + 1;
  }

  return previousState;
}