on

fun on(event: PortalEvents, handler: (data: Any) -> Unit)

Sets a listener for a specific event.

Parameters

event

The event to listen for.

handler

The function to call when the event occurs.