Skip to content

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

Closed
Gazler wants to merge 1 commit intojashkenas:masterfrom
Gazler:master
Closed

Forced options to be an object on collection.fetch#1058
Gazler wants to merge 1 commit intojashkenas:masterfrom
Gazler:master

Conversation

@Gazler
Copy link

@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
Copy link
Owner

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

@jashkenas jashkenas closed this Mar 12, 2012
@Gazler
Copy link
Author

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants