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

Call (Async)Generator.return() when appropriate #5

Closed
NfNitLoop opened this issue Apr 1, 2023 · 1 comment
Closed

Call (Async)Generator.return() when appropriate #5

NfNitLoop opened this issue Apr 1, 2023 · 1 comment

Comments

@NfNitLoop
Copy link
Owner

For lazy iteration that ends early (ex: first(), or limit()) we should make sure to call .return() on the inner Iterable if it's a Generator, so that it can clean up its resources.

@NfNitLoop
Copy link
Owner Author

... unless JS does that automatically in foreach loops? That would be nice.

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

No branches or pull requests

1 participant