ComputedNode<T> constructor
ComputedNode<T> (
- T getter(), {
- bool equals(
- T current,
- T? previous
- JoltDebugOption? debug,
Creates a computed node that evaluates getter lazily and caches results.
The getter callback runs while this node is the active subscriber. When
provided, equals can suppress propagation by returning true for a
newly computed value that should be treated as unchanged.
Implementation
ComputedNode(this.getter, {this.equals, JoltDebugOption? debug})
: super(flags: ReactiveFlags.none) {
assert(() {
JoltDevTools.create(this, debug);
return true;
}());
}