WatcherImpl<T> constructor
WatcherImpl<T> (})
Implementation
WatcherImpl(this.sourcesFn, this.fn,
{bool immediately = false,
this.when,
bool detach = false,
JoltDebugOption? debug}) {
raw = EffectNode(_effectFn, lazy: true, detach: detach, debug: debug);
previousValues = currentValues = raw.track(sourcesFn);
if (immediately) {
untracked(() {
final prevWatcher = Watcher.activeWatcher;
Watcher.activeWatcher = this;
try {
fn(currentValues, null);
} finally {
Watcher.activeWatcher = prevWatcher;
}
});
}
}