La referencia de la API está disponible solo en inglés por ahora.

When<EM extends EventMapBase>

type
types.ts:928

Matcher for event targeting across reducers, effects, middleware, and subscriptions. Supports four targeting modes: - { any: true } — match all events - { keys: [...] } — match specific [channel, type] pairs (correlated) - { channel: 'x' } — match all events in a channel - { channels: ['x', 'y'] } — match all events in multiple channels

Definition

type
type When<EM extends EventMapBase> = { any: true } | { keys: ReadonlyArray<EventKey<EM>> } | { channel: keyof EM & string } | { channels: ReadonlyArray<keyof EM & string> }

{ any: true } | { keys: ReadonlyArray<EventKey<EM>> } | { channel: keyof EM & string } | { channels: ReadonlyArray<keyof EM & string> }

Type parameters

NameTypeDescription
EMextends EventMapBaseEvent map.