medusa-extender / Exports / core/event-emmiter / Internals / CustomEventEmmiter
core/event-emmiter.Internals.CustomEventEmmiter
Extended event emitter to register methods that must be call when certain events are triggered and relay the handling to the API package
-
EventEmitter
↳
CustomEventEmmiter
• new CustomEventEmmiter()
EventEmitter.constructor
• Private
#listeners: Set
<ListenerDescriptor
<unknown
>>
▸ emitAsync<T
>(eventName
, values
): Promise
<T
>
Emit an asynchrone event entity based and wait for the result.
Name |
---|
T |
Name | Type | Description |
---|---|---|
eventName |
string | symbol |
The event that must be triggered |
values |
Record <string , unknown > |
The data that are passed to the event handler |
Promise
<T
>
▸ register<T
>(eventName
, propertyName
, metatype
): void
Register a new event handler.
Name |
---|
T |
Name | Type | Description |
---|---|---|
eventName |
string | symbol |
The name of the event that has to be triggered |
propertyName |
string |
The name of the class property that will handle the event |
metatype |
Type <T > |
The object that contains the property above |
void
▸ registerListeners(container
): void
Apply all event handlers hold by the listenerDescriptor
.
Name | Type | Description |
---|---|---|
container |
AwilixContainer <any > |
The IoC container that allow to resolve instance |
void
▸ unregisterListeners(): void
void