Macaw.Component.Assigns (macaw_component v0.1.2)

Copy Markdown View Source

The assigns a component renders with (spec/02 §1): context, settings, declarations, drawn, deliveries and value, and nothing else. Nothing else reaches a component: not the viewer, not another component, not the page.

Summary

Functions

The six keys, in order.

The assigns from a keyword list or a map: {:ok, assigns}, or every fault at once, a missing key :required and one it doesn't know :unknown_key. A pure component's value is nil; a contained one's deliveries is %{}.

Functions

keys()

@spec keys() :: [atom(), ...]

The six keys, in order.

new(attrs)

@spec new(keyword() | map()) ::
  {:ok, map()} | {:error, [Macaw.Component.fault(), ...]}

The assigns from a keyword list or a map: {:ok, assigns}, or every fault at once, a missing key :required and one it doesn't know :unknown_key. A pure component's value is nil; a contained one's deliveries is %{}.