on

abstract fun on(emitter: EventEmitter, name: String)

Adds the listener function to the end of the listeners array for the event named name to the emitter.

Parameters

emitter

The EventEmitter to add the listener to.

name

The name of the event to listen for.


abstract fun on(emitter: EventEmitter, name: String, options: Value)
abstract fun on(emitter: EventEmitter, name: String, options: EventsOnceOptions)

Adds the listener function to the end of the listeners array for the event named name to the emitter.

Parameters

emitter

The EventEmitter to add the listener to.

name

The name of the event to listen for.

options

The options to use when adding the listener.