# `OctaStar.Elements`

Datastar `datastar-patch-elements` helpers.

# `format_patch`

```elixir
@spec format_patch(
  iodata() | tuple() | nil,
  keyword()
) :: String.t()
```

Formats an element patch event without writing to a connection.

# `format_remove`

```elixir
@spec format_remove(
  String.t(),
  keyword()
) :: String.t()
```

Formats an element removal event without writing to a connection.

# `patch`

```elixir
@spec patch(Plug.Conn.t(), iodata() | tuple() | nil, keyword()) :: Plug.Conn.t()
```

Sends HTML elements to the browser for DOM patching.

# `remove`

```elixir
@spec remove(Plug.Conn.t(), String.t(), keyword()) :: Plug.Conn.t()
```

Sends an element removal patch.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
