EventDispatcher - Andrei15193/react-model-view-viewmodel GitHub Wiki
API / EventDispatcher<TSubject, TEventArgs> class
A base implementation of an event. To avoid misuse, declare a private event of this type and expose it as an IEvent<TSubject, TEventArgs>
.
Implements IEvent<TSubject, TEventArgs>.
class EventDispatcher<TSubject, TEventArgs = void>
implements IEvent<TSubject, TEventArgs>
Source reference: src/events/EventDispatcher.ts:9
.
-
TSubject - Optional, the type of object that raises the event.
-
TEventArgs - Optional, the type of the event context containing additional information about the event.
Default value:
void
.
-
constructor - Initializes a new instance of the
EventDispatcher<TSubject, TEventArgs>
class.
- dispatch - Dispatches a notification to all subscribers.
- subscribe - Subscribes the given eventHandler to the event.
- unsubscribe - Unsubscribes the given eventHandler to the event. The exact same object that was used to subscribe to the event must be passed as well.
- EventDispatcher<TSubject, TEventArgs>