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

break option inside forEach #58

Closed
demian85 opened this issue Oct 12, 2011 · 2 comments
Closed

break option inside forEach #58

demian85 opened this issue Oct 12, 2011 · 2 comments

Comments

@demian85
Copy link

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.

@demian85
Copy link
Author

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!

@caolan caolan closed this as completed Mar 28, 2014
@alizbazar
Copy link

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a temporary error. The following address(es) deferred:

alizbazar@gmail.com
Domain alizweb.com has exceeded the max emails per hour (139/120 (115%)) allowed. Message will be reattempted later

------- This is a copy of the message, including all the headers. ------
Received: from github-smtp2-ext3.iad.github.net ([192.30.252.194]:45306 helo=github-smtp2b-ext-cp1-prd.iad.github.net)
by web107.webhotelli.fi with esmtps (TLSv1:DHE-RSA-AES256-SHA:256)
(Exim 4.82)
(envelope-from noreply@github.com)
id 1WTaNI-0003cI-Ks
for alizbazar@alizweb.com; Fri, 28 Mar 2014 19:15:25 +0200
Date: Fri, 28 Mar 2014 10:15:22 -0700
From: Caolan McMahon notifications@github.com
Reply-To: caolan/async reply@reply.github.com
To: caolan/async async@noreply.github.com
Message-ID: caolan/async/issue/58/issue_event/106554097@github.com
In-Reply-To: caolan/async/issues/58@github.com
References: caolan/async/issues/58@github.com
Subject: Re: [async] break option inside forEach (#58)
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_5335ae2ac3d69_5da93f8778ed52a8706a5";
charset=UTF-8
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Recipient: alizbazar
List-ID: caolan/async <async.caolan.github.com>
List-Archive: https://github.com/caolan/async
List-Post: mailto:reply@reply.github.com
List-Unsubscribe: mailto:unsub+i-1887462-f8cf2296602a319eacceadec6f55278eaa6bc4ae-736771@reply.github.com,
https://github.com/notifications/unsubscribe/736771__eyJzY29wZSI6Ik5ld3NpZXM6TXV0ZSIsImV4cGlyZXMiOjE3MTE2NDYxMjIsImRhdGEiOnsiaWQiOjI4NzgzMTU0fX0=--62d298343d1420d6b43a70b2baa1e4156c011e00
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: alizbazar@alizweb.com

----==_mimepart_5335ae2ac3d69_5da93f8778ed52a8706a5
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Closed #58.


Reply to this email directly or view it on GitHub:
#58
----==_mimepart_5335ae2ac3d69_5da93f8778ed52a8706a5
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Closed #58.


Reply to this email directly or view it on GitHub.

----==_mimepart_5335ae2ac3d69_5da93f8778ed52a8706a5--

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

3 participants