Skip to content

PURISTA API / Modules / @purista/core / GenericEventEmitter

Class: GenericEventEmitter<T>

@purista/core.GenericEventEmitter

Type parameters

NameType
Textends EventMap

Hierarchy

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new GenericEventEmitter<T>(): GenericEventEmitter<T>

Type parameters

NameType
Textends EventMap

Returns

GenericEventEmitter<T>

Properties

emitter

Private emitter: EventEmitter

Defined in

core/types/GenericEventEmitter.ts:15

Methods

emit

emit<K>(eventName, parameter?): void

Type parameters

NameType
Kextends string

Parameters

NameType
eventNameK
parameter?T[K]

Returns

void

Implementation of

IEmitter.emit

Defined in

core/types/GenericEventEmitter.ts:24


off

off<K>(eventName, fn): void

Type parameters

NameType
Kextends string

Parameters

NameType
eventNameK
fnEventReceiver<T[K]>

Returns

void

Implementation of

IEmitter.off

Defined in

core/types/GenericEventEmitter.ts:20


on

on<K>(eventName, fn): void

Type parameters

NameType
Kextends string

Parameters

NameType
eventNameK
fnEventReceiver<T[K]>

Returns

void

Implementation of

IEmitter.on

Defined in

core/types/GenericEventEmitter.ts:16


removeAllListeners

removeAllListeners(): void

Returns

void

Defined in

core/types/GenericEventEmitter.ts:28