Skip to main content

ModuleEvent

This event is emitted when a module's onInit() method is run, once for every module id, with the inputs it ran with: the definition's values, references resolved, and schema defaults filled in. Its name is the module's class name.

@group

Events/Module

Hierarchy

  • Event<{ inputs: Record<string, unknown>; moduleId: string }>
    • ModuleEvent

Index

Constructors

Properties

Constructors

constructor

  • ModuleEvent(name?: string, payload?: { inputs: Record<string, unknown>; moduleId: string }): ModuleEvent
  • Parameters

    • optionalname: string

      The subject of the event, when the event type alone does not identify it.

    • optionalpayload: { inputs: Record<string, unknown>; moduleId: string }

      The event's data.

      • inputs: Record<string, unknown>
      • moduleId: string

    Returns ModuleEvent

Properties

readonlyinheritedheader

header: { sequence: number; timestamp: number }

When the event was created. sequence counts every event this process created, so it orders two events created in the same millisecond, and events a late listener receives replayed.


Type declaration

  • sequence: number
  • timestamp: number

readonlyinheritedname

name: string

The subject of the event, when the event type alone does not identify it - e.g. the class name on a registration event. Empty otherwise.

readonlyinheritedpayload

payload: { inputs: Record<string, unknown>; moduleId: string }

The event's data. Its shape is fixed by the event type.


Type declaration

  • inputs: Record<string, unknown>
  • moduleId: string
Page Options