on

fun on(eventName: String, handler: Value)

Called from inside the script to register a new event handler.

Parameters

eventName

Name of the event.

handler

JavaScript function used to handle the event.

  1. () => void (enable/disable)

  2. (Event) => void (handler)

  3. async (Event) => void (sequenceHandler)