OctaStar.Elements (octa_star v0.1.0)

Copy Markdown

Datastar datastar-patch-elements helpers.

Summary

Functions

Formats an element patch event without writing to a connection.

Formats an element removal event without writing to a connection.

Sends HTML elements to the browser for DOM patching.

Sends an element removal patch.

Functions

format_patch(elements, opts \\ [])

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

Formats an element patch event without writing to a connection.

format_remove(selector, opts \\ [])

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

Formats an element removal event without writing to a connection.

patch(conn, elements, opts \\ [])

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

Sends HTML elements to the browser for DOM patching.

remove(conn, selector, opts \\ [])

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

Sends an element removal patch.