Get the local or ajax sync call * @param {Model} model - Model to sync * @param {object} options - Options to pass, takes ajaxSync * @returns {function} The sync method that will be called
(model, options = {})
| 14 | * @returns {function} The sync method that will be called |
| 15 | */ |
| 16 | function getSyncMethod(model, options = {}) { |
| 17 | const forceAjaxSync = options.ajaxSync; |
| 18 | const hasLocalStorage = getLocalStorage(model); |
| 19 | |
| 20 | return !forceAjaxSync && hasLocalStorage ? localSync : ajaxSync |
| 21 | } |
| 22 | |
| 23 | |
| 24 | Backbone.sync = function(method, model, options) { |
no test coverage detected
searching dependent graphs…