Subscribable
Provides safe access to the public interface of
EventDispatcherBase
.
External classes can use it to subscribe to an event without being able todispatch it.
Type Parameters
-
TValueThe type of the argument passed to subscribers.
-
THandler extends EventHandler TValue = EventHandler TValueThe type of the callback function.
Extended by
-
SubscribableValueEvent
Constructors
constructor
public
new
Subscribable
TValue
THandler
extends
EventHandler
TValue
THandler
=
EventHandler
TValue
dispatcher
:
EventDispatcherBase
TValue
THandler
:
Subscribable
TValue
THandler
Type Parameters
Parameters
-
dispatcher : EventDispatcherBase TValue THandler
Methods
subscribe
public
subscribe
handler
:
THandler
: () =>
void
Subscribe to the event.
Parameters
-
handler : THandlerThe handler to invoke when the event occurs.
unsubscribe
public
unsubscribe
handler
:
THandler
:
void
Unsubscribe from the event.
Parameters
-
handler : THandlerThe handler to unsubscribe.