ixfx
    Preparing search index...
    • Iterates over the children of root, breadth-first

      Other iteration options:

      Type Parameters

      Parameters

      • root: T

        Root node

      • depth: number = Number.MAX_SAFE_INTEGER

        How many levels to traverse

      Returns IterableIterator<T>

      import { Trees } from "https://unpkg.com/@ixfx/collections/bundle"
      const myObj = { name: `Pedro`, size: 45, colour: `orange` };
      const root = Trees.FromObject.asDynamicTraversable(myObj);
      for (const v of Trees.Traverse.breadthFirst(root)) {
      // v.getValue() yields:
      // { name: 'name', sourceValue: 'Pedro' ...},
      // { name: 'size', sourceValue: 45 ... }
      // ...
      }