getDependencyK method

  1. @protected
Option<Dependency<Object>> getDependencyK(
  1. Entity typeEntity, {
  2. Entity groupEntity = const DefaultEntity(),
})

Returns any dependency with the exact typeEntity under the specified groupEntity. Unlike getDependency, this will not include subtypes.

Implementation

@protected
@pragma('vm:prefer-inline')
Option<Dependency> getDependencyK(
  Entity typeEntity, {
  Entity groupEntity = const DefaultEntity(),
}) {
  final a = TypeEntity(Sync, [typeEntity]);
  final b = TypeEntity(Async, [typeEntity]);
  return Option.from(
    _state[groupEntity]?.values.firstWhereOrNull(
      (e) => e.typeEntity == a || e.typeEntity == b,
    ),
  );
}