AshUi.Patch.Bindings (ash_ui v0.1.0)

Copy Markdown View Source

Registration-free event binding resolution over the compiled patch table.

A live binding key names WHERE the binding lives, not a session-registered value: child-addr… item-key… element-addr . dom-event (dot-joined components; addresses encode /→-, *→x). Resolution walks the key against the compiled tables — descending into child tables at child addresses, binding items by primary key at each boundaries — then re-evaluates the element's event bindings against the CURRENT record. The result is the same fully-evaluated EventBinding the render-time registration used to produce, with payload expressions evaluated at dispatch time from live state instead of captured at render.

Summary

Functions

Resolve a live binding key against record's resource.

Functions

resolve(record, binding_key, params \\ %{}, opts \\ [])

Resolve a live binding key against record's resource.

Returns {:ok, evaluated_binding, target} or :error. The target names the INSTANCE the action runs on — dispatch is backing-blind above it:

  • {:root} — the page row (bindings declared in the page's own view, including inside its eaches).
  • {:row, child_record} — a store-backed child instance: the action runs on the child's own row.
  • Embedded children reached through render(Child, input) are addressable only when the input is an instance path (DESIGN.md §4). A projected embedded value is traversal-only: its own events resolve to :error, while an addressable store-backed child nested inside it becomes that child's ordinary row target. (Embedded instances addressed by parent paths dispatch through AshUi.Patch.Dispatch.embedded_update/5.)