Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow breaking subtree for element-iterator #154

Merged
merged 1 commit into from
May 29, 2024

Conversation

Tidyzq
Copy link
Contributor

@Tidyzq Tidyzq commented May 20, 2024

Added [Symbol.iterator] for ElementIterator, which can support subtree-level breaking:

  • Passing false into the iterator (aka iterator.next(false)) will skip the following subtree
  • Breaking the iterator will skip the whole iteration

Examples:

    for (let node of glassEasel.ElementIterator.create(
      g,
      glassEasel.ElementIteratorType.ShadowDescendantsRootFirst,
      Object,
    )) {
        // iterate here
    }

@Tidyzq Tidyzq requested a review from LastLeaf May 20, 2024 08:42
@LastLeaf LastLeaf added this to the v0.6 milestone May 24, 2024
@Tidyzq Tidyzq force-pushed the feat-element-iterator-break-subtree branch from 6e929ee to aa5f5de Compare May 29, 2024 07:46
@LastLeaf LastLeaf merged commit fabd749 into master May 29, 2024
8 checks passed
@LastLeaf LastLeaf deleted the feat-element-iterator-break-subtree branch May 29, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants