class

EventEmitter::Base

Inherits Reference / Object

Instance methods

all(once = false, &block : Any -> )

Listen to all events and run the specified block. This is the same as doing emitter.on(/.*/) { ... }

Source
emit(event, arg = nil)

Emit an event with the specified arg

Source
on(event, *, once = false, &block : Any -> )

Listen for a particular event and fire the block every time that event is called. If once is true the event will be removed after it is fired the first time.

Source
once(event, &block : Any -> )

Sugar for on(event, once: true). Will fire the event once and then remove the listener.

Source
remove_listener(id_or_event)

Remove an event listener by id or event.

Source

Nested types