@microsoft/fast-element > SubscriberSet
SubscriberSet class
An implementation of Notifier that efficiently keeps track of subscribers interested in a specific change notification on an observable subject.
Signature:
export declare class SubscriberSet implements Notifier
Implements: Notifier
Remarks
This set is optimized for the most common scenario of 1 or 2 subscribers. With this in mind, it can store a subscriber in an internal field, allowing it to avoid Array#push operations. If the set ever exceeds two subscribers, it upgrades to an array automatically.
Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Creates an instance of SubscriberSet for the specified subject. |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
any |
The object that subscribers will receive notifications for. |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Checks whether the provided subscriber has been added to this set. | ||
|
Notifies all subscribers. | ||
|
Subscribes to notification of changes in an object's state. | ||
|
Unsubscribes from notification of changes in an object's state. |