Type alias StateReducer<Param, State>

StateReducer<Param, State>: Param extends void
    ? ((state) => Readonly<State>)
    : ((state, param) => Readonly<State>)

A single reducer for a State.

Type Parameters

  • Param

  • State

Example

interface State {
foos: string[]
}

type Reducer1 = StateReducer<string, State>
// (state: State, param: string) => State

type Reducer2 = StateReducer<void, State>
// (state: State) => State

Generated using TypeDoc