JoyDomEventHandler

The single host callback every node event binding dispatches into. There is no registry and no per-event registration: when any bound event fires, JoyDom invokes this with the full EventPayload, and the host switches on EventPayload.name to decide what to do (ignoring an event is just not matching it). Passing null (the default) still makes a bound node interactive (clickable/focusable) — the dispatch is just dropped.

JoyDom(spec, onEvent = { e ->
when (e.name) {
"charge" -> e.params?.getInt("amount")
"dismiss" -> dismiss()
}
})