Created
June 5, 2013 09:21
-
-
Save fiznool/5712705 to your computer and use it in GitHub Desktop.
Overriding Backbone.sync
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
// Store a copy of the original Backbone.sync | |
var originalSync = Backbone.sync; | |
// Override Backbone.sync for all future requests. | |
Backbone.sync = function(method, model, options) { | |
// Do something special here | |
// And then call the original sync | |
return originalSync.call(model, method, model, options); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment