once

fun once(event: String, handler: (data: Any) -> Unit)

Registers a one-time event listener for a specific event.

Parameters

event

The event name.

handler

The callback function to execute when the event is triggered. This handler will be removed after execution.