Class EventBus<EventName, Event>
Type Parameters
-
EventName extends string | number | symbol
-
Event
Constructors
constructor
- new EventBus<EventName, Event>(): EventBus<EventName, Event>
-
Type Parameters
-
EventName extends string | number | symbol
-
Event
Returns EventBus<EventName, Event>
Properties
Private
listenerMap
listenerMap: any
Private
off
off: any
Methods
dispatch
- dispatch(name, event): void
-
Parameters
-
name: EventName
-
event: Event
Returns void
dispose
- dispose(): void
-
Returns void
on
- on(name, listener): (() => void)
-
Parameters
-
name: EventName
-
listener: Listener<Event>
Returns (() => void)
once
- once(name, listener): (() => void)
-
Parameters
-
name: EventName
-
listener: Listener<Event>
Returns (() => void)