A2UI.Action (A2UI v0.3.0)

Copy Markdown View Source

An action triggered by user interaction with an A2UI component.

Actions have a name and optional context bindings that resolve against the data model when the action fires.

Examples

# Simple action
%A2UI.Action{name: "refresh"}

# Action with context
%A2UI.Action{name: "delete_item", context: %{
  "item_id" => %A2UI.BoundValue{path: "/selected/id"}
}}

Summary

Functions

Creates a simple action with no context.

Creates an action with context bindings.

Types

t()

@type t() :: %A2UI.Action{
  context: %{optional(String.t()) => A2UI.BoundValue.t()} | nil,
  name: String.t()
}

Functions

new(name)

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

Creates a simple action with no context.

new(name, context)

@spec new(String.t(), map()) :: t()

Creates an action with context bindings.