Skip to content

Instantly share code, notes, and snippets.

@samdelagarza
Created February 26, 2011 22:55
Show Gist options
  • Save samdelagarza/845711 to your computer and use it in GitHub Desktop.
Save samdelagarza/845711 to your computer and use it in GitHub Desktop.
Backbone.Collection = function (models, options) {
options || (options = {});
if (options.comparator) {
this.comparator = options.comparator;
delete options.comparator;
}
this._boundOnModelEvent = _.bind(this._onModelEvent, this);
this._reset();
if (models) this.refresh(models, { silent: true });
this.initialize(models, options);
};
console.log(new Backbone.Collection);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment