function addListener<T, A>(eventType, listener): (dispatcher) => Effect<TinyEventDispatcher<T, A>, never, never>;
Add the given listener for the given event to the given TinyEventDispatcher
.
Adding a given listener function reference is an idempotent operation. That is to say, irrespective of how many times a given listener is added for a given event, it will only be triggered once.
Note: the same listener function reference can be added for multiple different events.
• T
The possible event types that can be received
• A
The type of the event data which can be received
• eventType: T
The event to listen for
• listener: TinyEventListener
<T
, A
>
The listener function
Function
TinyEventDispatcher
value• dispatcher: TinyEventDispatcher
<T
, A
>
The TinyEventDispatcher
to add the listener to
Effect
<TinyEventDispatcher
<T
, A
>, never
, never
>