Skip to content

Instantly share code, notes, and snippets.

@sergiors
Created May 20, 2015 14:28
Show Gist options
  • Save sergiors/8e11b45021d59fcb3fe3 to your computer and use it in GitHub Desktop.
Save sergiors/8e11b45021d59fcb3fe3 to your computer and use it in GitHub Desktop.
fetch event
_.each(['Model', 'Collection'], function(name) {
var ctor = Backbone[name];
var fetch = ctor.prototype.fetch;
ctor.prototype.fetch = function() {
this.trigger('fetch', this);
return fetch.apply(this, arguments);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment