A2UI.BoundValue (A2UI v0.3.0)

Copy Markdown View Source

A value that can be a literal, a data model binding (JSON Pointer path), or both.

When both literal and path are set, the literal provides the initial value and the path creates a reactive binding — the component updates automatically when the data model changes at that path.

Examples

# Static value
%A2UI.BoundValue{literal: "Hello"}

# Bound to data model
%A2UI.BoundValue{path: "/user/name"}

# Initial value with binding
%A2UI.BoundValue{literal: "loading...", path: "/user/name"}

Summary

Functions

Creates a BoundValue bound to a data model path.

Creates a BoundValue with both a literal and a binding path.

Creates a BoundValue with a literal value.

Types

t()

@type t() :: %A2UI.BoundValue{literal: term() | nil, path: String.t() | nil}

Functions

bind(path)

@spec bind(String.t()) :: t()

Creates a BoundValue bound to a data model path.

bind(path, literal)

@spec bind(String.t(), term()) :: t()

Creates a BoundValue with both a literal and a binding path.

literal(value)

@spec literal(term()) :: t()

Creates a BoundValue with a literal value.