Phosphor::AppState
Immutable snapshot of the entire application at one moment in time.
AppState is a Crystal struct — value semantics, stack-allocated, no
shared mutable state. Every state change returns a new instance via a
with_* copy method; nothing mutates in place. Think of it as a strongly
typed params hash that describes the full page at a single frame.
Constructors
Instance methods
selected
Sourcetodos
SourceReturns a new AppState with selected replaced, all other fields unchanged.
Returns a new AppState with the todo at index toggled.
Rebuilds the array with only the target item replaced — no other todos
are touched and the original array is not mutated. index is clamped to
0..todos.size - 1; returns self when todos is empty.