Coordinates expression commit handlers per evaluation root and flushes them as one transaction boundary.
In practice, identifier updates call registerChange(...), the manager groups these handlers in a per-root queue, and commit emits a single committed-root signal after reevaluation stabilizes.
suspend(), continue(), and commit() do not take parameters.
Return type
All control methods return void.
commited is an observable event stream of committed root expressions.
Usage notes
suspend() pauses automatic flushing when state-manager cycles end.
continue() resumes and immediately triggers commit().
commit() flushes pending commit handlers for each root and emits on commited once that root has no pending handlers left in the current microtask pass.
Internal lifecycle
The manager listens to state-manager startChangeCycle and endChangeCycle. A depth counter gates auto-commit, so flush happens only when the outermost cycle finishes and batching is not suspended.
Pending work is stored as Map<rootExpression, Set<commitHandler>>. This deduplicates repeated handler registrations per root in one cycle.
Commit execution runs in microtask passes. Each pass can trigger additional registrations during reevaluation; the next microtask pass flushes those before final committed emission.