Event<EM extends EventMapBase = EventMapBase, C extends keyof EM & string = keyof EM & string, T extends keyof EM[C] & string = keyof EM[C] & string, P = EM[C][T]>
interfaceA single event object: { channel, type, payload, id }, plus optional meta.
- The
id field is automatically added by the store to enable deduplication, unless the
emitter supplies one via EmitOptions.id.
- Used for preventing duplicate event processing (e.g., React Strict Mode).
- meta is present only when EmitOptions.meta was supplied. See EventMeta.Type parameters
| Name | Type | Description |
|---|---|---|
EM | extends EventMapBase | Event map. |
C | extends keyof EM & string | Channel key. |
T | extends keyof EM[C] & string | Type key within channel C. |
P | — | Payload type (defaults to EM[C][T]). |
Properties
| Name | Type | Description |
|---|---|---|
channel | C | |
depth? | number | How many events deep in a causal chain this one is. A root event is depth 0; an event
emitted while handling it is 1, and so on. |
id | string | Unique identifier for deduplication and devtools tracking (automatically added by store) |
meta? | Readonly<Record<string, unknown>> | Optional caller-supplied metadata, carried through the pipeline untouched.
Absent entirely unless EmitOptions.meta was supplied. See EventMeta. |
parentId? | string | The id of the event whose handling caused this one, when there was one. |
payload | P | |
type | T |