Forked from elijahmanor/backbone-sync-override.js
Last active
August 29, 2015 14:03
-
-
Save onurozkan/3fde8985feebd0d2edec to your computer and use it in GitHub Desktop.
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
// The following could have been replaced by setting `Backbone.emulateHTTP = true;` | |
Backbone._sync = Backbone.sync; | |
Backbone.sync = function( method, model, options ) { | |
var beforeSend = options.beforeSend; | |
options = options || {}; | |
options.success = function(){ | |
options.Count = xhr.getResponseHeader("Count") | |
} | |
return Backbone._sync( method, model, options ); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment