setGroup method

  1. @protected
void setGroup(
  1. TDependencyGroup<Object> group, {
  2. Entity groupEntity = const DefaultEntity(),
})

Updates the state by setting or replacing the group under the specified groupEntity.

Implementation

@protected
void setGroup(
  TDependencyGroup<Object> group, {
  Entity groupEntity = const DefaultEntity(),
}) {
  final currentGroup = _state[groupEntity];
  final equals = const MapEquality<Entity, Dependency>().equals(
    currentGroup,
    group,
  );
  if (!equals) {
    _state[groupEntity] = group;
    UNSAFE:
    onChange.ifSome((self, some) => some.unwrap()()).end();
  }
}