findAsync<S> static method
Asynchronously resolves a dependency of type S or identified by key or tag.
Useful for dependencies registered via lazyPutAsync. Throws an Exception if no registration is found.
Implementation
static Future<S> findAsync<S>({dynamic key, String? tag}) async {
if (key is LevitState) {
final result = await key.findAsyncIn(Ls.currentScope, tag: tag);
if (result is Future) return await result as S;
return result as S;
}
return Ls.findAsync<S>(tag: tag);
}