maybeFinishK<T extends Object> method

void maybeFinishK<T extends Object>({
  1. required Entity g,
})
inherited

Attempts to finish any pending untilExactlyK calls for the given type and group. Matches on typeEntity only — is Foo<T> collapses to is Foo<dynamic> under dart2js release and would mis-match.

Implementation

void maybeFinishK<T extends Object>({required Entity g}) {
  assert(T != Object, 'T must be specified and cannot be Object.');
  final typeEntity = TypeEntity(T);
  for (final di in [this as DI, ...children().unwrapOr([])]) {
    final test = di.completersK[g]?.firstWhereOrNull(
      (e) => e.typeEntity == typeEntity,
    );
    if (test != null) {
      test.complete(const None()).end();
      break;
    }
  }
}