These are chat archives for madglory/backbone-fetch-cache

10th
Jan 2015
Lior Chen
@liorch88
Jan 10 2015 11:46

Yeah, but to generate the key I see you pass the getCacheKey method with the this - which is precisely what they do internally, if you pass them an object:

function getCache(key, opts) {
    if (_.isFunction(key)) {
      key = key();
    } else if (key && _.isObject(key)) {
      key = Backbone.fetchCache.getCacheKey(key, opts);
    }
...
  }

  function clearItem(key, opts) {
    if (_.isFunction(key)) {
      key = key();
    } else if (key && _.isObject(key)) {
      key = Backbone.fetchCache.getCacheKey(key, opts);
    }
...
  }

Same goes for getLastSync, as it calls getCache internatlly.