Created
May 20, 2015 14:28
-
-
Save sergiors/8e11b45021d59fcb3fe3 to your computer and use it in GitHub Desktop.
fetch event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.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