# `StarView.Page.Assigns`
[🔗](https://github.com/Neophen/star_view/blob/v0.7.0/lib/star_view/page/assigns.ex#L2)

Assign helpers that work in both halves of a StarView page module.

`use StarView.Page` imports these instead of `Phoenix.Component`'s assign
family, so one set of names works everywhere:

- On a `%Plug.Conn{}` (in `mount/2`, `handle_event/3`, `handle_connect/2`,
  `handle_info/2`) they behave like `Plug.Conn.assign/3`.
- On anything else (sockets, assigns maps inside function components)
  they delegate to `Phoenix.Component`.

# `assign`

Assigns one key/value or many key/values.

    conn |> assign(:count, 1)
    conn |> assign(count: 1, name: "myko")

Keys must be atoms when assigning to a `%Plug.Conn{}`, matching
`Plug.Conn.assign/3` semantics.

# `assign`

# `assign_new`

Assigns a value computed by `fun` only when `key` is absent.
`fun` may take zero arguments or the current assigns.

# `update`

Updates an existing assign with `fun`. Raises `KeyError` if absent.

