updateNode method
Updates the node and reports whether its value changed.
This method is called by updateCustom when the reactive system needs to update this node. Implementations should:
- Update any internal state or cached values
- Return
trueif the node's value has changed (subscribers will be notified) - Return
falseif the value is unchanged (no notifications will be sent)
The return value determines whether subscribers are notified of changes.
If true is returned, the reactive system will propagate updates to
all subscribers of this node.
Returns: true if the value changed, false otherwise
Example:
@override
bool updateNode() {
final oldValue = _cachedValue;
_cachedValue = _computeNewValue();
return oldValue != _cachedValue;
}
Implementation
@override
bool updateNode() {
if (_dirty) {
_dirty = false;
return true;
}
return false;
}