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

Forced options to be an object on collection.fetch #1058

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@Gazler

Gazler commented Feb 29, 2012

On collection.fetch, the argument being sent through will default to an empty object if the object sent through is not an object. This is because if you call collection.fetch with an array as an argument (for example in a callback) then the "reset" event is not triggered.

@jashkenas

This comment has been minimized.

Show comment
Hide comment
@jashkenas

jashkenas Mar 12, 2012

Owner

Why would you call fetch() with an array as an argument?

Owner

jashkenas commented Mar 12, 2012

Why would you call fetch() with an array as an argument?

@jashkenas jashkenas closed this Mar 12, 2012

@Gazler

This comment has been minimized.

Show comment
Hide comment
@Gazler

Gazler Mar 12, 2012

In the specific example, I was using it as a callback from pusher and I wanted to call collection.fetch() directly as a callback, I was simply trying to avoid doing something along the lines of:

pusherFetch: function() {
  this.fetch();
}

Gazler commented Mar 12, 2012

In the specific example, I was using it as a callback from pusher and I wanted to call collection.fetch() directly as a callback, I was simply trying to avoid doing something along the lines of:

pusherFetch: function() {
  this.fetch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment