call method

S call(
  1. S state,
  2. dynamic action
)

The Reducer function that converts the current state and action into a new state

Implementation

S call(S state, action) {
  if (action is CreateOne<T>) {
    return this.adapter.addOne(action.entity, state);
  }
  if (action is UpdateOne<T>) {
    return this.adapter.upsertOne(action.entity, state);
  }
  if (action is DeleteOne<T>) {
    return adapter.removeOne(action.id, state);
  }

  return state;
}