Function: defineEventHandler()
Function: defineEventHandler()
Utility function to define an event handler.
Param
The EventHandler module.
Param
Optional handler definition options.
Param
Indicates that the handler is a factory function.
Param
Indicates that the handler is a class.
Param
The action name for the event handler.
Call Signature
function defineEventHandler<U>(module): MetaEventHandler<U>;
Utility function to define a function-based event handler.
Type Parameters
U
U
extends IIncomingEvent
= IIncomingEvent
Parameters
module
The EventHandler module.
Returns
The MetaEventHandler.
Param
The EventHandler module.
Param
Optional handler definition options.
Param
Indicates that the handler is a factory function.
Param
Indicates that the handler is a class.
Param
The action name for the event handler.
Call Signature
function defineEventHandler<U>(module, options): MetaEventHandler<U>;
Utility function to define a factory-based event handler.
Type Parameters
U
U
extends IIncomingEvent
= IIncomingEvent
Parameters
module
The EventHandler module.
options
Options to specify the handler type.
action?
string
isClass?
undefined
isFactory
true
Indicates that the handler is a factory function.
Returns
The MetaEventHandler.
Param
The EventHandler module.
Param
Optional handler definition options.
Param
Indicates that the handler is a factory function.
Param
Indicates that the handler is a class.
Param
The action name for the event handler.
Call Signature
function defineEventHandler<U>(module, options): MetaEventHandler<U>;
Utility function to define a class-based event handler.
Type Parameters
U
U
extends IIncomingEvent
= IIncomingEvent
Parameters
module
The EventHandler module.
options
Options to specify the handler type.
action
string
The action name for the event handler.
isClass
true
Indicates that the handler is a class.
isFactory?
undefined
Returns
The MetaEventHandler.
Param
The EventHandler module.
Param
Optional handler definition options.
Param
Indicates that the handler is a factory function.
Param
Indicates that the handler is a class.
Param
The action name for the event handler.