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

EventMapCarrier<EMAdd extends EventMapBase>

interface
types.ts:1961

Phantom carrier for the event map a spec contributes.

EMAdd cannot be inferred from a spec's when: { keys: [["chan", "evt"]] } carries channel and type strings and no payload types, so there is nothing to infer a map from. And TypeScript has no partial type-argument inference, so a registerSlice<N, St, EMAdd> would force a caller who names EMAdd to hand-write N and St too. The way out is to put EMAdd in a **value** position, where inference works. The builders (defineSlice, defineMiddleware, defineEffect) brand a spec with this interface, and the register methods read it back with EMAddOf. Nothing exists at runtime; the property is never assigned. The property is **required, not optional**: an optional one makes X extends EventMapCarrier<infer E> match every object and infer unknown. And it is a *function* type so EMAdd sits in both co- and contravariant position, which keeps the inference exact rather than widening to a supertype.

Type parameters

NameTypeDescription
EMAddextends EventMapBase

Properties

NameTypeDescription
~yoltraEventMap(em: EMAdd) => EMAddPhantom. Never present at runtime, and never read.