Skip to content

Instantly share code, notes, and snippets.

@fiznool
Created June 5, 2013 09:21
Show Gist options
  • Save fiznool/5712705 to your computer and use it in GitHub Desktop.
Save fiznool/5712705 to your computer and use it in GitHub Desktop.
Overriding Backbone.sync
// 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