Class: Notifier<T>
libs/common/util/Notifier.Notifier
Type parameters
| Name | Type |
|---|---|
T | extends Arr = [] |
Constructors
constructor
• new Notifier<T>()
Type parameters
| Name | Type |
|---|---|
T | extends 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
| Name | Type |
|---|---|
...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
| Name | Type | Description |
|---|---|---|
listener | Listener<[]> | A function to be called when notifyListeners is called |
Returns
A function that can be called to unsubscribe from notifications
Defined in
libs/common/util/Notifier.ts:27