Solid.Context (solid v0.15.2) View Source

Link to this section Summary

Functions

Get data from context respecting the scope order provided.

Find the current value that cycle must return

Link to this section Types

Specs

scope() :: :counter_vars | :vars | :iteration_vars

Specs

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

Link to this section Functions

Link to this function

get_in(context, key, scopes)

View Source

Specs

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

Specs

run_cycle(
  t(),
  [{:values, [String.t()]}] | [name: String.t(), values: [String.t()]]
) ::
  {t(), String.t()}

Find the current value that cycle must return