Interface IEventEmission<TPayload>

This represents the object that is passed to event handlers

interface IEventEmission<TPayload> {
    data: TPayload;
    id: string;
    meta: IEventMeta;
    source: string;
    tags: TagType[];
    timestamp: Date;
    isPropagationStopped(): boolean;
    stopPropagation(): void;
}

Type Parameters

  • TPayload = any

Properties

data: TPayload

The data that the event carries. It can be anything.

id: string

The ID of the event. This is the same as the event's ID. This is useful for global event listeners.

Metadata associated with the event definition.

source: string

The source of the event. This can be useful for debugging.

tags: TagType[]

The tags that the event carries.

timestamp: Date

The timestamp when the event was created.

Methods

  • Returns true if propagation has been stopped.

    Returns boolean

  • Stops propagation to remaining event listeners.

    Returns void