processPendingInnerEffects method

void processPendingInnerEffects(
  1. Subscriber sub,
  2. int flags
)

Ensures all pending internal effects for the given subscriber are processed.

This should be called after an effect decides not to re-run itself but may still have dependencies flagged with PendingEffect. If the subscriber is flagged with PendingEffect, this function clears that flag and invokes notifyEffect on any related dependencies marked as Effect and Propagated, processing pending effects.

Parameters:

  • sub: The subscriber which may have pending effects.
  • flags: The current flags on the subscriber to check.

Implementation

void processPendingInnerEffects(Subscriber sub, int flags) {
  if ((flags & SubscriberFlags.pendingEffect) != 0) {
    sub.flags = flags & ~SubscriberFlags.pendingEffect;
    Link? link = sub.deps;
    do {
      final dep = link!.dep;
      if (dep is Subscriber &&
          ((dep as Subscriber).flags & SubscriberFlags.effect) != 0 &&
          ((dep as Subscriber).flags & SubscriberFlags.propagated) != 0) {
        notifyEffect(dep as Subscriber);
      }
      link = link.nextDep;
    } while (link != null);
  }
}