API Reference

Expression Change Transaction Manager

Batch model updates so observers receive one consolidated commit notification instead of many intermediate updates.

Interface: IExpressionChangeTransactionManager

Description

Coordinates commit boundaries for expression evaluation. Internally, expression evaluate managers subscribe once and flush pending work when commits are triggered.

It also provides a shared microtask queue via scheduleDirtyFlush(...) so multiple dirty managers can flush once per microtask instead of creating independent flush loops.

Parameters

listener() => void

Commit listener passed to subscribeCommitted(listener). Returns an unsubscribe function.

managerIDirtyFlushable

Dirty manager passed to scheduleDirtyFlush(manager). Must expose flush(): void.

suspend(), continue(), and commit() do not take parameters.

Return type

All control methods return void.

subscribeCommitted(...) returns an unsubscribe callback.

Usage notes

suspend() pauses automatic flushing when state-manager cycles end.

continue() resumes and immediately triggers commit().

Keep suspend() / continue() calls balanced. continue() decrements internal suspend depth.

Internal lifecycle

subscribeCommitted(...) listeners are one-shot per commit call. Internally, listeners are copied, cleared, then invoked.

scheduleDirtyFlush(...) batches dirty managers in a shared set and flushes them in the next microtask using queueMicrotask.

If suspended, commit() is ignored until suspension depth returns to zero.