LevitReactiveNotifier class
A low-latency notifier for synchronous reactive updates.
LevitReactiveNotifier is the high-performance core of the reactive system. Unlike StreamController, it provides zero-latency notifications through synchronous callbacks and implements several optimizations for large-scale reactive graphs.
Performance Optimizations
- Fast Path: Direct call for single-listener, no-batch scenarios.
- Topological Ordering: Derived values (like computeds) notify only after their dependencies have updated, preventing "glitches".
- Deduplication: Prevents duplicate propagation in complex "diamond" dependency patterns.
- Zero-Allocation Snapshots: Caches listener lists to avoid allocation during notification cycles.
Constructors
Properties
- graphDepth ↔ int
-
Returns the current depth in the dependency graph.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListener → bool
-
Whether there are active listeners.
no setter
- isDisposed → bool
-
Whether the notifier is disposed.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
void listener()) → void - Adds a listener.
-
dispose(
) → void - Disposes the notifier.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
) → void - Notifies all listeners of a change.
-
removeListener(
void listener()) → void - Removes a listener.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited