State structure
Presentum manages state as a map of slots, where each slot represents one surface in your app.Visual representation
Imagine three surfaces with different presentations:State object
Hereβs the actual state object:Slots
Each slot is a container for one surface:Active item
Theactive item is whatβs currently displayed. Only one item can be active per surface.
Queue
Thequeue is a FIFO (First In, First Out) list of items waiting their turn.
When the active item is dismissed, the first queued item automatically becomes active:
Before dismiss:
state.clearActive(surface) or presentum.markDismissed(item).
State intentions
Every state change has an intention controlling history management:Usage in guards
State queries
Access and query state:Mutable vs Immutable
Presentum uses two state types:- PresentumState$Immutable
- PresentumState$Mutable
Read-only snapshot exposed to widgets and observers.Benefits:
- Predictable - never changes unexpectedly
- Testable - compare with
== - Debuggable - inspect snapshots