Skip to content

feature proposal: iterable interfaces #23

Description

@derhuerst

Using iterables to walk over a large amount of items/data has two advantages:

  • In contrast to computing a full array all items, items can be read from the tree on the fly. This prevents unnecessary graph walks.
  • Iterables are well-supported within ECMAScript and libs: String, Array, Map, Set etc. are iterable.

Examples of how iterables would be useful for this lib:

for (const key of tree.keys()) {
  await userRequestedAKey()
  console.log(key)
}

for (const node of tree.range('A', 'O')) {
  console.log(node.data)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions