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

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

type
types.ts:1185

Handler 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

NameTypeDescription
SStore state type (readonly).
EMextends EventMapBaseEvent map.