ReducerSpec<S = any, EM extends EventMapBase = EventMapBase>

interface
types.ts:958

One reducer's definition blob (stateful event consumer).

Use when for event targeting (preferred). The events property is kept for backward compatibility but when is recommended for new code.

Type parameters

NameTypeDescription
SState managed by this reducer.
EMextends EventMapBaseEvent map.

Properties

NameTypeDescription
meta?EventConsumerMeta<"reducer">Optional metadata for debugging tools and DevTools integration.
reducerReducerFunction<S, EM>Pure reducer function: (state, event) => nextState.
stateSInitial state for this reducer.
when?When<EM>Event targeting using the unified When matcher.