Skip to main content

ModelRegistrationEvent

This event is emitted when a class with @Model() decorator is registered. It emits the name of the class.

@example
const myEvent = new ModelRegistrationEvent('MyClass');
EventService.getInstance().emit(myEvent);
@returns

The Event instance.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • Parameters

    • payload: string
    • userData: object = {}

    Returns ModelRegistrationEvent

Properties

readonlyheader

header: { timestamp: number }

Type declaration

  • timestamp: number

readonlypayload

payload: string

readonlyuserData

userData: object

Methods

staticregistrar

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


    Parameters

    • eventService: EventService

      Arguments are spread out using the array spread operator.

    • descriptor: PropertyDescriptor

    Returns void