Interface IEventEmission<TPayload>

This represents the object that is passed to event handlers

interface IEventEmission<TPayload> {
    data: TPayload;
    id: string | symbol;
    source: string | symbol;
    timestamp: Date;
}

Type Parameters

  • TPayload = any

Properties

Properties

data: TPayload

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

id: string | symbol

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

source: string | symbol

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

timestamp: Date

The timestamp when the event was created.