588 B
588 B
Commands Rules
commands/is the only place state changes are implemented.- Commands may change persistent
ImageDocumentstate and transientEditorState. - Commands must be deterministic, testable, and side-effect free.
- Do not import React, DOM UI, renderer/WebGL internals, storage, network, timers, or filesystem APIs.
- Validate payloads before applying changes.
- Preserve all
core/andeditor/invariants. - Return the next
AppState; do not mutate existing state objects in place. - Every command needs a stable id, clear payload type, and focused responsibility.