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.

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) {
      return e is ReservedSafeCompleter<T> || e.typeEntity == typeEntity;
    });
    if (test != null) {
      test.complete(const None()).end();
      break;
    }
  }
}