EventSubscriptionHandler<S = any, EM extends EventMapBase = EventMapBase>
typeHandler function for event subscriptions (receives full event union). Event subscriptions are intended for the View layer (e.g., React components) to react to events without affecting the event flow. They are fire-and-forget and cannot cancel event propagation.
Definition
type
type EventSubscriptionHandler<S = any, EM extends EventMapBase = EventMapBase> = (event: EventUnion<EM>, getState: () => S, emit: Emit<EM>, phase: "committed" | "uncommitted") => void | Promise<void>(event: EventUnion<EM>, getState: () => S, emit: Emit<EM>, phase: "committed" | "uncommitted") => void | Promise<void>
Type parameters
| Name | Type | Description |
|---|---|---|
S | — | Store state type (readonly). |
EM | extends EventMapBase | Event map. |