# `LivePanels.Canvas.Transaction`
[🔗](https://github.com/livepanels/livepanels/blob/v0.1.0/lib/livepanels/canvas/transaction.ex#L1)

Command composition context for one socket-bound canvas mutation.

`LivePanels.Canvas.transaction/2` and `LivePanels.Canvas.transaction!/2` pass
this context to ordinary owner
modules. The owner modules append command values while the context keeps a
preview of the evolving canvas state, so derived actions such as move and
resize can compose with earlier commands in the same transaction.

Application code should not construct this struct directly. Use
`LivePanels.Canvas.transaction/2` to receive a result tuple or
`LivePanels.Canvas.transaction!/2` to receive the socket or raise; LivePanels
creates the transaction context and passes it to the callback.

# `t`

```elixir
@type t() :: %LivePanels.Canvas.Transaction{
  actor: term(),
  command_type: term(),
  commands: term(),
  commit_result_runner: term(),
  normalize_command: term(),
  preview_command: term(),
  rejected: term(),
  socket: term(),
  state: term()
}
```

Transaction context passed to `LivePanels.Canvas.transaction/2` callbacks.

---

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