notifyEffect method

  1. @override
bool notifyEffect(
  1. Subscriber effect
)
override

Handles effect notifications by processing the specified effect.

When an effect first receives any of the following flags:

  • dirty
  • pendingComputed
  • pendingEffect this method will process them and return true if the flags are successfully handled. If not fully handled, future changes to these flags will trigger additional calls until the method eventually returns true.

Implementation

@override
bool notifyEffect(Subscriber effect) {
  if (effect is EffectScope) {
    return notifyEffectScope(effect);
  }

  final flags = effect.flags;
  if ((flags & SubscriberFlags.dirty) != 0 ||
      ((flags & SubscriberFlags.pendingComputed) != 0 &&
          updateDirtyFlag(effect, flags))) {
    runEffect(effect as Effect);
  } else {
    processPendingInnerEffects(effect, effect.flags);
  }
  return true;
}