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

Returning value on success #1

Closed
wants to merge 1 commit into from

Conversation

ruiramos
Copy link

Care for a pull request in a 8loc module? ;)

@shinnn
Copy link
Contributor

shinnn commented Dec 23, 2014

@ruiramos Maybe try-catch module meets your requirements.

@@ -3,7 +3,7 @@
// and provides a cleaner API.
module.exports = function (fn, cb) {
try {
fn();
return fn();
if (cb) cb(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't reach L7 if you added return to L6.

@HenrikJoreteg
Copy link
Owner

Hi @ruiramos! Thanks, but like @shinnn pointed out I want it to call that callback. If you return, then that won't happen.

@ruiramos
Copy link
Author

ruiramos commented Jan 5, 2015

You guys right, different use case, sorry! 👍

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.

3 participants