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

pass last result to while/until callback #963

merged 2 commits into from Nov 26, 2015

Conversation

@benfleis
Copy link
Contributor

benfleis commented Nov 25, 2015

Addresses #962

@thanodnl
thanodnl reviewed Nov 25, 2015
View changes
lib/async.js Outdated
@@ -781,7 +781,7 @@
} else if (test.apply(this, args)) {
iterator(next);
} else {
callback(null);
callback(null, args[0]);

This comment has been minimized.

Copy link
@thanodnl

thanodnl Nov 25, 2015

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 benfleis force-pushed the benfleis:master branch to 8acc85d Nov 25, 2015
@benfleis

This comment has been minimized.

Copy link
Contributor Author

benfleis commented Nov 25, 2015

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

@megawac

This comment has been minimized.

Copy link
Collaborator

megawac commented Nov 25, 2015

👍

@aearly

This comment has been minimized.

Copy link
Collaborator

aearly commented Nov 25, 2015

👍 a nice enhancement.

@aearly aearly added the feature label Nov 25, 2015
@benfleis

This comment has been minimized.

Copy link
Contributor Author

benfleis commented Nov 26, 2015

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

@megawac
megawac reviewed Nov 26, 2015
View changes
README.md Outdated
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.

This comment has been minimized.

Copy link
@megawac

megawac Nov 26, 2015

Collaborator

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.

This comment has been minimized.

Copy link
@benfleis

benfleis Nov 26, 2015

Author Contributor

Thanks, should have read that out loud first :)

Update coming.

@benfleis benfleis force-pushed the benfleis:master branch to f937650 Nov 26, 2015
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
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.