Skip to content

Instantly share code, notes, and snippets.

@andyperlitch
Created April 24, 2013 19:30
Show Gist options
  • Save andyperlitch/5454868 to your computer and use it in GitHub Desktop.
Save andyperlitch/5454868 to your computer and use it in GitHub Desktop.
a simple extension to Backbone.Collection.set method
var oldSet = Backbone.Collection.prototype.set;
Backbone.Collection.prototype.set = function(models, options) {
options = options || {};
oldSet.call(this, models, options);
if (options.silent) return this;
this.trigger('update', this, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment