Emitter

warning

This is an internal module. Do not use this in your codebase as it may change or be removed entirely without warning in future versions of Gears.

Description

A typesafe EventEmitter

Generics

Events

Methods

emit(type, data)void
Parameters
type:
E
data:
Events[E]
getListenerCount(type)number
Parameters
type:
E
hasListeners(type)boolean
Parameters
type:
E
off(type, handler)void
Parameters
type:
E
handler:
EventHandler<Events[E]>
on(type, handler)void
Parameters
type:
E
handler:
EventHandler<Events[E]>
once(type, handler)void
Parameters
type:
E
handler:
EventHandler<Events[E]>
pipe(type, emitter)void
Parameters
type:
E
emitter:
T
waitFor(type)Promise<Events[E]>
Parameters
type:
E