@laserware/stasis
    Preparing search index...

    Type Alias CaseReducer<S, A>

    CaseReducer: (
        state: Draft<S>,
        action: A,
    ) => NoInfer<S> | void | Draft<NoInfer<S>>

    A case reducer is a reducer function for a specific action type. Case reducers can be composed to full reducers using createReducer().

    Unlike a normal Redux reducer, a case reducer is never called with an undefined state to determine the initial state. Instead, the initial state is explicitly specified as an argument to createReducer().

    In addition, a case reducer can choose to mutate the passed-in state value directly instead of returning a new state. This does not actually cause the store state to be mutated directly; instead, thanks to immer, the mutations are translated to copy operations that result in a new state.

    Type Parameters

    Type declaration

      • (state: Draft<S>, action: A): NoInfer<S> | void | Draft<NoInfer<S>>
      • Parameters

        Returns NoInfer<S> | void | Draft<NoInfer<S>>