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

pass last result to while/until callback #963

Merged
merged 2 commits into from
Nov 26, 2015
Merged

Conversation

benfleis
Copy link

Addresses #962

@@ -781,7 +781,7 @@
} else if (test.apply(this, args)) {
iterator(next);
} else {
callback(null);
callback(null, args[0]);

Choose a reason for hiding this comment

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

Is there a reason to only pass on 1 argument instead of all the arguments that were passed to the cb?

For example waterfall passes on all the arguments from cb on to the next function.

incorporate @thanodnl suggestions to pass all args

also tidy up the test changes
@benfleis
Copy link
Author

addressed @thanodnl 's suggestion, and tidied tests a bit.

@megawac
Copy link
Collaborator

megawac commented Nov 25, 2015

👍

@aearly
Copy link
Collaborator

aearly commented Nov 25, 2015

👍 a nice enhancement.

@aearly aearly added the feature label Nov 25, 2015
@benfleis
Copy link
Author

@megawac @aearly @thanodnl
Just added to the PR/branch, with an updated README to reflect the changes.

execution of `fn` has stopped.
* `callback(err, [results])` - A callback which is called after the test fails
and repeated execution of `fn` has stopped. This will be passed the results
of the last call to `fn`'s callback.
Copy link
Collaborator

Choose a reason for hiding this comment

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

A callback which is called after the test fails and repeated execution of fn has stopped. This will be passed the results of the last call to fn's callback.

This doesn't read so well, maybe

A callback which is called after the test function has failed and repeated execution of fn has stopped. The callback will be passed an error and any arguments passed to the final fn's callback.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, should have read that out loud first :)

Update coming.

megawac added a commit that referenced this pull request Nov 26, 2015
pass last result to while/until callback
@megawac megawac merged commit e7b334c into caolan:master Nov 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants