unLinkTo method

bool unLinkTo(
  1. dynamic from,
  2. dynamic to, {
  3. List anyTags = const [],
  4. List allTags = const [],
})
override

Remove a directed link, but will not remove from and to

(Optional) Only if it matches any of anyTags and matches all items in allTags

Implementation

bool unLinkTo(from, to, {List anyTags = const [], List allTags = const []}) {
  final _f = _map_add_or_get(from, _newNode);
  final _t = _map_add_or_get(to, _newNode);
  if (_check_hasTo_and_all_any_tags(_f, _t,
      anyTags: anyTags, allTags: allTags)) {
    // unsetTo will delete the edge and tab
    final a = _f.unsetTo(_t);
    final b = _t.unsetFrom(_f);
    return a || b;
  }
  return false;
}