notifyCustom<T> function
Invalidates a custom reactive node so that subscribers re-evaluate without changing the stored value.
This function marks a custom reactive node as dirty and notifies all its subscribers to re-evaluate. Unlike notifySignal and notifyComputed, this function works with any ReactiveNode, including CustomReactiveNode instances.
The node is marked as dirty and mutable, and all subscribers are propagated. If not in a batch, effects are flushed immediately.
Parameters:
node: Custom reactive node to invalidate
Example:
final customNode = CustomWidgetPropsNode<MyWidget>();
notifyCustom(customNode); // Triggers subscriber re-evaluation
Implementation
@pragma("vm:prefer-inline")
@pragma("wasm:prefer-inline")
@pragma("dart2js:prefer-inline")
void notifyCustom<T>(ReactiveNode node) {
node.flags = ReactiveFlags.mutable | ReactiveFlags.dirty;
final subs = node.subs;
if (subs != null) {
propagate(subs);
if (batchDepth == 0) {
flushEffects();
}
}
JoltDebug.notify(node);
}