resume method
Resumes the watcher, re-enabling it to respond to changes.
When resumed, the watcher will:
- Re-collect dependencies by tracking the watched sources
- Start responding to changes in watched sources again
Parameters:
tryRun: Iftrue, attempts to run the watcher immediately after re-collecting dependencies. Iffalse, only re-collects dependencies without executing the callback.
Example:
final watcher = Watcher(...);
watcher.pause();
// Resume without executing
watcher.resume();
// Resume and try to run immediately
watcher.resume(tryRun: true);
Implementation
@override
void resume([bool tryRun = false]) {
assert(!isDisposed, "Watcher is disposed");
_isPaused = false;
if (!tryRun) {
trackWithEffect(sourcesFn, this);
} else {
trackWithEffect(_effectFn, this);
}
}