# `Plushie.Runtime.Commands`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.7.2/lib/plushie/runtime/commands.ex#L1)

Command execution engine for the Plushie runtime.

Handles all `%Plushie.Command{}` types returned by `app.update/2` and
`app.init/1`. The single public entry point is `execute_commands/2`,
which threads state through each command and returns the updated state.

# `dispatch_depth_limit`

Maximum synchronous dispatch chain depth.

`Command.dispatch/1` queues a follow-up event in the runtime's
mailbox. A pathological `update` that keeps emitting another
`Command.dispatch` would fill the mailbox indefinitely; the runtime
bumps a depth counter per chained event and drops the command when
the counter reaches this cap.

# `execute_commands`

```elixir
@spec execute_commands([Plushie.Command.t()] | Plushie.Command.t(), map()) :: map()
```

Executes a list of commands (or a single command), threading the runtime
state through each one. Batch commands are flattened recursively.

---

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