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

void DoFirstWith2<A extends Comp<T>, B extends Comp<T>>(
  1. void fn(
    1. E entity,
    2. A a,
    3. B b
    )
)

Query-like Calls fn with the first matching element and its A and B components. Does nothing if the result set is empty.

Implementation

void DoFirstWith2<
  A extends Comp<T>,
  B extends Comp<T>
>(void Function(E entity, A a, B b) fn) {
  final entities = _resolve();
  if (entities.isEmpty) return;
  final entity = entities.first;
  entity.on2<A, B>((a, b) => fn(entity, a, b));
}