Skip to main content

Class: Notifier<T>

libs/common/util/Notifier.Notifier

Type parameters

NameType
Textends Arr = []

Constructors

constructor

new Notifier<T>()

Type parameters

NameType
Textends readonly unknown[] = []

Defined in

libs/common/util/Notifier.ts:11

Properties

listeners

Private listeners: Listener<T>[] = []

Defined in

libs/common/util/Notifier.ts:9

Methods

notifyListeners

notifyListeners(...args): void

Notify all listeners that something has changed

Parameters

NameType
...args[...T[]]

Returns

void

Defined in

libs/common/util/Notifier.ts:18


registerListener

registerListener(listener): Disposable

Register to be notified when notifyListeners is called

Parameters

NameTypeDescription
listenerListener<[]>A function to be called when notifyListeners is called

Returns

Disposable

A function that can be called to unsubscribe from notifications

Defined in

libs/common/util/Notifier.ts:27