Skip to main content
Version: 4.5

Class: EventManager#

core.EventManager

Constructors#

constructor#

+ new EventManager(subscribers: EventSubscriber<any>[]): EventManager

Parameters:#

NameType
subscribersEventSubscriber<any>[]

Returns: EventManager

Defined in: packages/core/src/events/EventManager.ts:9

Properties#

entities#

Private Readonly entities: Map<EventSubscriber<any>, string[]>

Defined in: packages/core/src/events/EventManager.ts:9


listeners#

Private Readonly listeners: Partial<Record<EventType, EventSubscriber<any>[]>>

Defined in: packages/core/src/events/EventManager.ts:8

Methods#

dispatchEvent#

dispatchEvent<T>(event: TransactionEventType, args: TransactionEventArgs): unknown

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
eventTransactionEventType
argsTransactionEventArgs

Returns: unknown

Defined in: packages/core/src/events/EventManager.ts:25

dispatchEvent<T>(event: onInit, args: Partial<EventArgs<T>>): unknown

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
eventonInit
argsPartial<EventArgs<T>>

Returns: unknown

Defined in: packages/core/src/events/EventManager.ts:26

dispatchEvent<T>(event: EventType, args: Partial<FlushEventArgs | EventArgs<T>>): Promise<unknown>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
eventEventType
argsPartial<FlushEventArgs | EventArgs<T>>

Returns: Promise<unknown>

Defined in: packages/core/src/events/EventManager.ts:27


getSubscribedEntities#

PrivategetSubscribedEntities(listener: EventSubscriber<any>): string[]

Parameters:#

NameType
listenerEventSubscriber<any>

Returns: string[]

Defined in: packages/core/src/events/EventManager.ts:70


hasListeners#

hasListeners<T>(event: EventType, meta: EntityMetadata<T>): boolean

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
eventEventType
metaEntityMetadata<T>

Returns: boolean

Defined in: packages/core/src/events/EventManager.ts:51


registerSubscriber#

registerSubscriber(subscriber: EventSubscriber<any>): void

Parameters:#

NameType
subscriberEventSubscriber<any>

Returns: void

Defined in: packages/core/src/events/EventManager.ts:15

Last updated on by Martin Adámek