-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
break option inside forEach #58
Comments
Is anyone still interested in this? I just had the same problem and couldn't find my way out of the iterator! EDIT: I'm such an idiot, the solution is much simpler than I thought. Just call the callback with an Error and done! |
This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its alizbazar@gmail.com ------- This is a copy of the message, including all the headers. ------ ----==_mimepart_5335ae2ac3d69_5da93f8778ed52a8706a5 Closed #58. Reply to this email directly or view it on GitHub: Closed #58. — ----==_mimepart_5335ae2ac3d69_5da93f8778ed52a8706a5-- |
I think it would be nice to include a "break" option inside an iterator to emulate the 'break' statement used in loops.
Actually I created my own by sending an extra parameter to the iterator called 'break'. It can be done just by calling the callback manually but it's not so practical to create a reference to the end callback before calling async.forEach
If you think it is useful enough I can send a pull request.
The text was updated successfully, but these errors were encountered: