View Source Solid.Context (solid v0.17.1)

Summary

Functions

Get data from context respecting the scope order provided.

Find the current value that cycle must return

Types

@type scope() :: :counter_vars | :vars | :iteration_vars
@type t() :: %Solid.Context{
  counter_vars: map(),
  cycle_state: map(),
  errors: [Solid.UndefinedVariableError],
  iteration_vars: %{optional(String.t()) => term()},
  matcher_module: module(),
  vars: map()
}

Functions

Link to this function

get_in(context, key, scopes)

View Source
@spec get_in(t(), [term()], [scope()]) ::
  {:ok, term()} | {:error, {:not_found, [term()]}}

Get data from context respecting the scope order provided.

Possible scope values: :counter_vars, :vars or :iteration_vars

Link to this function

put_errors(context, errors)

View Source
Link to this function

run_cycle(context, cycle)

View Source
@spec run_cycle(
  t(),
  [{:values, [String.t()]}] | [name: String.t(), values: [String.t()]]
) ::
  {t(), String.t()}

Find the current value that cycle must return