isInstantiated<S> method
Whether type S has already been instantiated.
Implementation
bool isInstantiated<S>({dynamic key, String? tag}) {
if (key is LevitStore) {
final scope = _ScopeProvider.of(_context) ?? Ls.currentScope;
return key.isInstantiatedIn(scope, tag: tag);
}
if (key is LevitAsyncStore) {
final scope = _ScopeProvider.of(_context) ?? Ls.currentScope;
return key.isInstantiatedIn(scope, tag: tag);
}
final scope = _ScopeProvider.of(_context);
if (scope != null) {
return scope.isInstantiated<S>(tag: tag);
}
return Levit.isInstantiated<S>(tag: tag);
}