registerListener

inline fun <T : Event, E : T> EventNode<T>.registerListener(handler: Consumer<E>)

Registers an event listener for the given event type T to this event node, calling the given handler when the event is fired.

Return

this event node

Parameters

T

the type of event the node accepts

E

the type of event to listen for

handler

the handler for the event