AshUi.Datastar.FragmentRender (ash_ui_datastar v0.1.0)

Copy Markdown View Source

Projects the neutral AshUi.Rendered algebra through the core AshUi.Diff kernel into Datastar updates.

The core kernel owns fingerprints, dynamic invalidation, duplicate-key checks, and keyed entry changes. This adapter renders the corresponding Datastar-target element and encodes only the selector-scoped SSE operation required to apply that result.

Summary

Functions

full_render(record, table, opts \\ [])

@spec full_render(struct(), AshUi.Patch.Table.t(), keyword()) :: binary()

initial_render(record, table, opts \\ [])

@spec initial_render(struct(), AshUi.Patch.Table.t(), keyword()) :: {binary(), map()}

patch(record, changed, table)

@spec patch(struct(), MapSet.t() | :all | struct(), AshUi.Patch.Table.t()) :: [
  AshUi.Datastar.SSE.event()
]

patch(record, changed, table, opts)

@spec patch(struct(), MapSet.t() | :all | struct(), AshUi.Patch.Table.t(), keyword()) ::
  [
    AshUi.Datastar.SSE.event()
  ]

patch(old, new, forced, table, opts)

render(record, changed, forced, table, live_state, opts)

@spec render(
  struct(),
  MapSet.t() | :all,
  list(),
  AshUi.Patch.Table.t(),
  map(),
  keyword()
) ::
  {[AshUi.Datastar.SSE.event()], map()}