Simple subscribable object.
It's generally good practice not to expose a property of this type, since the notify function is public. Insead, it is recommended to make the notifier private and expose a getter with the type Subscribable.
Constructor.
Whether there are any subscribers.
Notifies all subscribers.
The value to be passed to all subscribers.
Subscribes to be notified when an event occurs.
The callback function.
Unsubscribes.
True if the subscription was canceled, false otherwise.
Simple subscribable object.
Remarks
It's generally good practice not to expose a property of this type, since the notify function is public. Insead, it is recommended to make the notifier private and expose a getter with the type Subscribable.