collect-your-stuff
    Preparing search index...

    Variable servicesConst

    services: {
        parseTree: (tree: IsTree, callback: forEachCallback) => IsTree;
        parseTreeNext: (
            treeNode: IsTreeNode,
            boundaryParent?: IsTreeNode,
        ) => IsTreeNode;
    } = ...

    List helpful functions when dealing with collections.

    Type Declaration

    • parseTree: (tree: IsTree, callback: forEachCallback) => IsTree

      Loop over all the nodes in a tree starting from left and apply a callback for each

    • parseTreeNext: (treeNode: IsTreeNode, boundaryParent?: IsTreeNode) => IsTreeNode

      Be able to parse over every node in a tree.

      1. Start at root (get root parent)
      2. Get first child (repeat until no children)
      3. Check next child
      4. Repeat 2
      5. Repeat 3
      6. If no next child, return to parent and repeat 3
      7. Stop at root (next is null and parent is null A boundary can be given to parse only part of a tree: going back up to the parents stops at the boundary, so the parsing stays within the nodes whose parent is the boundary (and everything below them).