EffectScopeNode class
Low-level node that owns effects created within a scope.
This is the graph node behind EffectScope. While active, it becomes the
ambient scope for newly created effects unless detach is true.
Prefer EffectScope in application code; use EffectScopeNode when integrating custom lifecycle management with the core graph.
Example:
final scope = EffectScopeNode();
scope.run(() {
EffectNode(() => print('inside scope'));
});
scope.dispose();
- Inheritance
-
- Object
- ReactiveNode
- BaseEffectNode
- EffectScopeNode
Constructors
- EffectScopeNode({bool detach = false, JoltDebugOption? debug})
- Creates a scope node.
Properties
- deps ↔ Link?
-
First dependency link in the chain.
getter/setter pairinherited
- depsTail ↔ Link?
-
Last dependency link in the chain.
getter/setter pairinherited
- flags ↔ int
-
Reactive flags for this node.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
Whether dispose has been called on this scope.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subs ↔ Link?
-
First subscriber link in the chain.
getter/setter pairinherited
- subsTail ↔ Link?
-
Last subscriber link in the chain.
getter/setter pairinherited
Methods
-
cleanup(
) → void -
Runs all registered cleanup callbacks and clears the registry.
inherited
-
dispose(
) → void -
Disposes this node, unlinks dependencies, and runs cleanup.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onCleanup(
Disposer cleanup) → void -
Registers
cleanupto run on the nextcleanupor dispose.inherited -
run<
T> (T fn()) → T -
Runs
fnwith this scope as the active subscriber and ambient scope. -
toString(
) → String -
A string representation of this object.
inherited
-
unwatched(
) → void -
Disposes this scope when it loses its last watcher.
override
-
update(
) → bool -
Resets transient scheduling flags on this scope.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited