ifAvailable method
Executes consumer if the object is available.
- NoUniquePodDefinitionException if more than one matching object exists.
Implementation
Future<void> ifAvailable(Consumer<ObjectHolder<T>> consumer) async {
final dependency = await getIfAvailable();
if (dependency != null) {
consumer.call(dependency);
}
}