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

Don't pass the callback to the handler #15

Merged
merged 2 commits into from
Dec 23, 2016

Conversation

dmihal
Copy link
Contributor

@dmihal dmihal commented Dec 11, 2016

The publish handler was being passed the callback function as an argument. This can cause issues with publish functions that set default values for the last parameter.

For example:

Meteor.publish('files', function(limit=10) {
...
const collector = new PublicationCollector();
collector.collect('files', function(collections) {
...

Currently, the limit value will be set to the callback function, instead of 10. Moving these lines until after the args.pop() method is called removes the callback from the argument list.

The publish handler was being passed the callback function as an argument. This can cause issues with publish functions that set default values for the last parameter.
@johanbrook
Copy link
Collaborator

Good catch, thanks! 👏 Are there any tests we can add for this before merging?

@dmihal
Copy link
Contributor Author

dmihal commented Dec 23, 2016

Test added!

@johanbrook johanbrook merged commit f76e0d9 into Meteor-Community-Packages:master Dec 23, 2016
@johanbrook
Copy link
Collaborator

Thanks!

@johanbrook
Copy link
Collaborator

Published as 1.0.5 🎉

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.

2 participants