MCPcopy Index your code
hub / github.com/jeromegn/Backbone.localStorage / getSyncMethod

Function getSyncMethod

src/driver.js:16–21  ·  view source on GitHub ↗

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 = {})

Source from the content-addressed store, hash-verified

14 * @returns {function} The sync method that will be called
15 */
16function getSyncMethod(model, options = {}) {
17 const forceAjaxSync = options.ajaxSync;
18 const hasLocalStorage = getLocalStorage(model);
19
20 return !forceAjaxSync && hasLocalStorage ? localSync : ajaxSync
21}
22
23
24Backbone.sync = function(method, model, options) {

Callers 1

driver.jsFile · 0.85

Calls 1

getLocalStorageFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…