getChildT method

Option<Result<DI>> getChildT({
  1. Entity groupEntity = const DefaultEntity(),
})
inherited

Type-keyed variant of getChild.

Implementation

Option<Result<DI>> getChildT({Entity groupEntity = const DefaultEntity()}) {
  final g = groupEntity.preferOverDefault(focusGroup);
  if (childrenContainer case Some(value: final container)) {
    return switch (container.getLazySingletonT<DI>(DI, groupEntity: g)) {
      None() => const None(),
      Some(value: Sync(value: final result)) => Some(result.transf<DI>()),
      Some(value: Async()) =>
        Some(Err('getChildT: lazy singleton resolved async, not supported.')),
    };
  }
  return const None();
}