EventPayload

data class EventPayload(val type: EventType, val name: String, val params: EventParams?, val payload: EventParams? = null, val target: EventTarget)

Passed to the host's JoyDomEventHandler when a bound event fires. Mirrors React's EventBinding dispatch (js/react/src/types.ts): the spec carries no DOM event, so instead of a SyntheticEvent the payload names the type kind alongside the bound name and its params.

target identifies the node the event fired on — the joy-dom analog of the DOM event.target. It is always present (every dispatch has an originating node), even when that node has no id.

params is always the binding's static params exactly as authored in the spec JSON; payload is runtime data a custom component passed to ComponentScope.emit (the DOM analog is CustomEvent.detail). The two are never merged, so the handler can always tell author data from component data.

Constructors

Link copied to clipboard
constructor(type: EventType, name: String, params: EventParams?, payload: EventParams? = null, target: EventTarget)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val payload: EventParams? = null
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun EventPayload.runtimePayload(): <Error class: unknown class>

The runtime data a custom component passed to emit — what {"$event": …} reads, before the binding's own params are merged over it.

Link copied to clipboard
fun EventPayload.toBinding(): <Error class: unknown class>

The renderer's EventPayload as the binding the interpreter runs.