How to use the @collectable/red-black-tree.remove function in @collectable/red-black-tree

To help you get started, we’ve selected a few @collectable/red-black-tree examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github frptools / collectable / packages / sorted-set / src / internals / assignment.ts View on Github external
export function unsetItem (value: T, map: ValueMap, tree: Sorted): boolean {
  var entry: SortedSetItem|undefined;

  update(arg => {
    if(isDefined(arg)) entry = arg;
    return void 0;
  }, value, map);

  if(isDefined(entry)) {
    remove(entry, tree);
    return true;
  }

  return false;
}

@collectable/red-black-tree

[Collectable.js] Immutable Red-Black Tree

MIT
Latest version published 3 years ago

Package Health Score

46 / 100
Full package analysis

Similar packages