AshSDUI.Context (ash_sdui v0.2.0)

Copy Markdown View Source

Runtime presentation context used while resolving SDUI views.

The context is intentionally generic. Applications can pass actors, tenants, audiences, device hints, locale, or arbitrary assigns without AshSDUI baking in app-specific role or group concepts.

Summary

Functions

Returns an assign from the context.

Builds a context from a keyword list, map, or existing context.

Types

t()

@type t() :: %AshSDUI.Context{
  actor: term(),
  assigns: map(),
  audience: atom() | String.t() | nil,
  device: atom() | String.t() | nil,
  locale: String.t() | nil,
  tenant: term()
}

Functions

get_assign(context, key, default \\ nil)

@spec get_assign(t(), atom() | String.t(), term()) :: term()

Returns an assign from the context.

new(context)

@spec new(keyword() | map() | t() | nil) :: t()

Builds a context from a keyword list, map, or existing context.