Skip to main content

Class: EventController

The Event Controller, The base class for Event which is used in event files.

EventController

Constructors

new EventController()

new EventController(application, container, logger, utilities): EventController

Parameters

application: Express

container: Record<string, any> & Locals

logger: Logger

utilities: UtilitiesType

Returns

EventController

Defined in

registry/types/Events/BaseEventType.ts:29

Methods

run()

run(..._args): any

The run function for this event, this function cannot be redefined to use another name, but only the content within the function.

For listeners listening on ApplicationEvent.ALL, the first parameter is the event that was emitted, followed by any argument for that event.

Placeholder run function if nothing is defined:

Parameters

• ..._args: any[]

Returns

any

Example

return;

@public

Defined in

registry/types/Events/BaseEventType.ts:55


setApplicationEventOptions()

setApplicationEventOptions(): EventListenerOptions

Set the details for this event.

Returns

EventListenerOptions

Example

// Default Event Config
return {
type: ApplicationEvent.ALL,
};

@public

Defined in

registry/types/Events/BaseEventType.ts:70