SignalNode<T> class

Low-level reactive node that stores a mutable value.

This is the graph node behind Signal. It tracks subscribers, participates in batching, and propagates updates when set or notify runs.

Prefer Signal in application code; use SignalNode when implementing custom primitives on the core graph.

Example:

final node = SignalNode<int>(0);
final effect = Effect(() => print(node.get()));
node.set(1);
effect.dispose();
node.dispose();
Inheritance

Constructors

SignalNode(T? value, {JoltDebugOption? debug})
Creates a signal node initialized to value.

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 node.
no setter
pendingValue ↔ T?
The value that will be committed on the next get or update.
getter/setter pair
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
value ↔ T?
The last value committed by get or update.
getter/setter pair

Methods

dispose() → void
Disposes this node and removes it from the dependency graph.
get() → T
Returns the current value and links this node to the active subscriber.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify() → void
Forces subscribers to update without changing pendingValue.
peek() → T
Returns pendingValue without establishing a reactive dependency.
set(T value) → T
Stores value, marks the node dirty when it changes, and propagates.
toString() String
A string representation of this object.
inherited
unwatched() → void
Called when this node loses its last subscriber.
override
update() bool
Commits pendingValue as the current value.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited