on

abstract fun on(eventName: String, listener: Value): EventEmitter
abstract fun on(eventName: String, listener: EventListener): EventEmitter

Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added.

Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

Parameters

eventName

The name of the event.

listener

The callback function.