Skip to content

Type Alias: CommandFn<Ctx>

CommandFn<Ctx> = (state, payload, ctx) => StatePatch | null | undefined

Defined in: modal/engine.ts:173

A command's reduction: (state, payload, ctx) → patch. Pure — reads the frozen pre-state, returns the regions it moves (or null/undefined for a deliberate no-op). It never mutates, never performs effects (effects are claims), and never needs to read back a write: the patch IS the write.

Type Parameters

Ctx

Ctx

Parameters

state

EngineState

payload

unknown

ctx

Ctx

Returns

StatePatch | null | undefined