PhoenixDnd.CommandBatch (phoenix_dnd v0.1.0)

Copy Markdown View Source

An ordered, revision-gated batch of server-to-client commands.

Command batches are best-effort. Durable state must be represented by the next PhoenixDnd.Scene snapshot so reconnects can recover without replaying old events.

Summary

Types

t()

@type t() :: %PhoenixDnd.CommandBatch{
  after_revision: non_neg_integer(),
  commands: [PhoenixDnd.Command.t()],
  id: String.t(),
  version: 1
}

Functions

new!(commands, opts \\ [])

@spec new!(
  [PhoenixDnd.Command.t()],
  keyword()
) :: t()

to_payload(batch, editor_id)

@spec to_payload(t(), String.t()) :: map()