on

abstract fun <E : T> on(eventClass: KClass<E>, action: (E) -> Unit)

Subscribes the action to be executed when an event of type E is emitted.


open override fun <E : T> on(eventClass: Class<E>, eventListener: EventListener<in E>)

Subscribes the eventListener to be executed when an event of type E is emitted. Provides the same functionality as EventEmitter.on with a more convenient style when used from Java.