on2<A extends Comp<T>, B extends Comp<T>> method

Comp<T> on2<A extends Comp<T>, B extends Comp<T>>(
  1. void callback(
    1. A,
    2. B
    )
)
inherited

Invokes callback with the first top-level components matching types A and B, if both exist.

Implementation

E on2<
  A extends Comp<T>,
  B extends Comp<T>
>(
  void Function(A, B) callback
) {
  final a = get<A>(), b = get<B>();
  if (a == null || b == null) return self;
  callback(a, b);
  return self;
}