When<EM extends EventMapBase>
typeMatcher 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
| Name | Type | Description |
|---|---|---|
EM | extends EventMapBase | Event map. |