Tracks the currently active Observable.batch() nesting depth and the
set of ListenerRegistrys pending notification once the outermost batch
completes.
Supports nested batches via a depth counter: only the outermost
batch() call actually flushes pending notifications, so a nested
batch() call is a no-op with respect to flushing. Pending registries
are deduplicated (a Set), so an observable written multiple times
inside the same batch still notifies exactly once.
Rastreia a profundidade de aninhamento atual de Observable.batch() e o
conjunto de ListenerRegistrys pendentes de notificação assim que o
batch mais externo terminar.
Suporta batches aninhados via um contador de profundidade: apenas a
chamada batch() mais externa de fato libera as notificações
pendentes, então uma chamada batch() aninhada é um no-op quanto ao
flush. Os registros pendentes são deduplicados (um Set), então um
observável escrito múltiplas vezes dentro do mesmo batch ainda assim
notifica exatamente uma vez.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- flushEpoch → int
-
Monotonic identifier for the currently running batch flush. Intended for
internal schedulers that need to distinguish invalidations from the same
flush wave from future external writes.
no setter
- isActive → bool
-
Whether a
batch()call is currently active (depth > 0), OR the outermostbatch()call is currently flushing its queued notifications/recomputes. The latter matters for Computed: a recompute triggered during the flush (e.g.doubledrecomputing and notifyingsum, which in turn depends ontripledtoo) must still defer instead of running eagerly, or the diamond glitch would simply move one level down the cascade instead of being fixed. See_flushPendingfor the fixed-point loop this enables.no setter
Static Methods
-
queue(
ListenerRegistry registry) → void -
Queues
registryto be notified once when the outermost batch ends. -
queueDirtyFlush(
void callback()) → void -
Queues
callback(deduplicated) to run once, after every pending ListenerRegistry has already been flushed, when the outermost batch ends. Used by Computed to recompute (and, if changed, notify) marked -dirty derived values exactly once per batch, after all of their upstream dependencies have already settled to their final value — see the "diamond glitch" note onComputed's class doc. -
run(
void action()) → void -
Runs
actioninside a batch: writes to any Observable or reactive collection duringactionare coalesced so every distinct changed observable notifies its listeners exactly once, afteractionreturns. Nested calls are supported — only the outermost call flushes.