Resolves a component's properties to the values a renderer displays.
The component's catalog schema says how each property behaves:
- dynamic (
DynamicString,DataBinding, … — anything that may be a binding or a function call) — evaluated against the data model; - action — kept as the raw action object, to be resolved with
A2UICore.Resolution.DataContext.resolve_action/2when triggered; - structural (
ChildList,ComponentId, templates) — kept as is, for the node resolver to expand; - checkable — the rule list is kept and the owning object gains
"isValid","validationErrors"and"validationResult"; - objects and arrays are resolved member by member.
Where the schema says nothing (a component whose schema is an allOf
envelope, an unknown component, a property the schema does not
declare) the behavior is inferred from the value's shape, as the
reference binder does.
The result is a snapshot: bind/4 is pure and returns the resolved
properties together with the warnings and errors raised while
evaluating them (A2UICore.Resolution.DataContext.effect/0).
Reactive updates are the host's job — it rebinds when the data model or
the component changes.
Summary
Types
How a property behaves at runtime.
Functions
Resolves component's properties in context.
The behavior of a schema: :dynamic, :action, :structural,
:checkable, :static, {:object, shape} or {:array, element}.
Types
Functions
@spec bind( A2UICore.Resolution.DataContext.t(), A2UICore.State.Component.t(), A2UICore.Catalog.t() | nil, keyword() ) :: {map(), [A2UICore.Resolution.DataContext.effect()]}
Resolves component's properties in context.
catalog supplies the component's schema (nil or a catalog without
the component falls back to shape inference). Option :schema
overrides the component schema.
With wrap: true every dynamic position comes back as an
A2UICore.Resolution.Binding (writable when it was bound to a path,
read-only for a literal or a call, and a read-only nil binding when
the component omitted it) and every action as an
A2UICore.Resolution.Action, instead of bare values. The positions are
those the schema declares, allOf envelopes included.
The behavior of a schema: :dynamic, :action, :structural,
:checkable, :static, {:object, shape} or {:array, element}.
defs are the definitions its $refs resolve against.