isRegistered<S> method
Whether type S is registered in the current or any parent scope.
Implementation
bool isRegistered<S>({dynamic key, String? tag}) {
if (key is LevitStore) {
final scope = _ScopeProvider.of(_context) ?? Ls.currentScope;
return key.isRegisteredIn(scope, tag: tag);
}
if (key is LevitAsyncStore) {
final scope = _ScopeProvider.of(_context) ?? Ls.currentScope;
return key.isRegisteredIn(scope, tag: tag);
}
final scope = _ScopeProvider.of(_context);
if (scope != null) {
return scope.isRegistered<S>(tag: tag);
}
return Levit.isRegistered<S>(tag: tag);
}