Skip to main content

ModuleEvent

This event is emitted when a module's onInit() method is run. It emits the name of the module.

@example
const myEvent = new ModuleEvent('MyModule');
EventService.getInstance().emit(myEvent);
@returns

The Event instance.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new ModuleEvent(payload: string, userData?: object): ModuleEvent
  • Parameters

    • payload: string
    • userData: object = {}

    Returns ModuleEvent

Properties

readonlyheader

header: { timestamp: number }

Type declaration

  • timestamp: number

readonlypayload

payload: string

readonlyuserData

userData: object

Methods

staticregistrar

  • registrar(...args: [EventService, PropertyDescriptor]): void
  • The registrar() method is explicitly called by the EventSource decorator for a method to enhance the method to auto-emit events.


    Parameters

    • rest...args: [EventService, PropertyDescriptor]

      Arguments are spread out using the array spread operator.

    Returns void