isInstantiated<S> method

bool isInstantiated<S>({
  1. String? tag,
})

Whether type S has already been instantiated.

Implementation

bool isInstantiated<S>({String? tag}) {
  if (isRegisteredLocally<S>(tag: tag)) {
    final key = _getKey<S>(tag);
    return _registry[key]!.isInstantiated;
  }
  if (_parentScope != null) return _parentScope!.isInstantiated<S>(tag: tag);
  return false;
}