removeManyToMany function

void removeManyToMany(
  1. ReactiveModel owner,
  2. List<ReactiveModel> sharedChildren, {
  3. Symbol? field,
})

Remove shared children from owner

Implementation

void removeManyToMany(
  ReactiveModel owner,
  List<ReactiveModel> sharedChildren, {
  Symbol? field,
}) {
  for (final child in sharedChildren) {
    owner.nestedModels.remove(child);
    if (child is HasParent) child._parents.remove(owner);
  }
  owner.notifyListeners(field);
}