run method

  1. @override
void run()
override

Manually runs the effect function.

This establishes the effect as the current reactive context, allowing it to track dependencies accessed during execution.

Example:

final effect = Effect(() => print('Hello'), lazy: false);
effect.run(); // Prints: "Hello"

Implementation

@override
void run() {
  if (!isDisposed) {
    flags |= ReactiveFlags.dirty;
    runEffect();
  } else {
    untracked(_effectFn);
  }
}