resetLazySingletonK<T extends Object> method

  1. @protected
Resolvable<Unit> resetLazySingletonK<T extends Object>(
  1. Entity typeEntity, {
  2. Entity groupEntity = const DefaultEntity(),
})
inherited

Resets the singleton instance of a lazily loaded dependency.

Implementation

@protected
Resolvable<Unit> resetLazySingletonK<T extends Object>(
  Entity typeEntity, {
  Entity groupEntity = const DefaultEntity(),
}) {
  final temp = getK<T>(
    TypeEntity(Lazy, [typeEntity]),
    groupEntity: groupEntity,
  );
  if (temp.isSome()) {
    UNSAFE:
    return temp.unwrap().then((e) {
      (e as Lazy).resetSingleton();
      return Unit();
    });
  }
  return syncUnit();
}