AshSDUI.Runtime.State (ash_sdui v0.3.0)

Copy Markdown View Source

Shared runtime state helpers for SDUI views and components.

Summary

Functions

apply_selection(state, params)

@spec apply_selection(AshSDUI.View.State.t() | nil, map()) :: AshSDUI.View.State.t()

apply_workflow(state, params)

@spec apply_workflow(AshSDUI.View.State.t() | nil, map()) :: AshSDUI.View.State.t()

begin_operation(state, name, attrs \\ %{})

@spec begin_operation(
  AshSDUI.View.State.t() | nil,
  atom() | String.t(),
  map() | keyword() | nil
) ::
  AshSDUI.View.State.t()

clear_errors(state)

@spec clear_errors(AshSDUI.View.State.t() | nil) :: AshSDUI.View.State.t()

complete_operation(state, name, attrs \\ %{})

@spec complete_operation(
  AshSDUI.View.State.t() | nil,
  atom() | String.t(),
  map() | keyword() | nil
) ::
  AshSDUI.View.State.t()

errors(state)

@spec errors(AshSDUI.View.State.t() | map() | nil) :: map()

last_error(state)

@spec last_error(AshSDUI.View.State.t() | map() | nil) :: term() | nil

mark_binding_refreshed(state, binding_name)

@spec mark_binding_refreshed(AshSDUI.View.State.t() | nil, atom()) ::
  AshSDUI.View.State.t()

mark_offline(state, reason \\ true)

@spec mark_offline(AshSDUI.View.State.t() | nil, term() | nil) ::
  AshSDUI.View.State.t()

mark_online(state)

@spec mark_online(AshSDUI.View.State.t() | nil) :: AshSDUI.View.State.t()

normalize(state)

@spec normalize(AshSDUI.View.State.t() | map() | nil | struct()) :: map()

offline?(state)

@spec offline?(AshSDUI.View.State.t() | map() | nil) :: boolean()

optimistic_operations(state)

@spec optimistic_operations(AshSDUI.View.State.t() | map() | nil) :: map()

pending_count(state)

@spec pending_count(AshSDUI.View.State.t() | map() | nil) :: non_neg_integer()

pending_operation?(state, operation_name)

@spec pending_operation?(AshSDUI.View.State.t() | map() | nil, atom() | String.t()) ::
  boolean()

pending_operations(state)

@spec pending_operations(AshSDUI.View.State.t() | map() | nil) :: map()

record_error(state, name, reason)

@spec record_error(AshSDUI.View.State.t() | nil, atom() | String.t(), term()) ::
  AshSDUI.View.State.t()

refresh_meta(state, binding_name)

@spec refresh_meta(AshSDUI.View.State.t() | map() | nil, atom() | nil) :: map()

refresh_snapshot(bindings, state)

@spec refresh_snapshot(map(), AshSDUI.View.State.t() | nil) :: map()

rollback_operation(state, name, attrs \\ %{})

@spec rollback_operation(
  AshSDUI.View.State.t() | nil,
  atom() | String.t(),
  map() | keyword() | nil
) ::
  AshSDUI.View.State.t()

selected_records(state, records)

@spec selected_records(AshSDUI.View.State.t() | map() | nil, list() | nil) :: list()

state_slice(state, state_key)

@spec state_slice(
  AshSDUI.View.State.t() | map() | nil,
  atom() | String.t() | [atom() | String.t()] | nil
) :: term()

update(state, fun)

@spec update(AshSDUI.View.State.t() | nil, (AshSDUI.View.State.t() ->
                                        AshSDUI.View.State.t())) ::
  AshSDUI.View.State.t()