Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am bencolon on github.
  • I am bencolon (https://keybase.io/bencolon) on keybase.
  • I have a public key whose fingerprint is CFCF 5CCA 4CE7 22B0 E961 FEC7 7F03 5CD2 FE4F C3FB

To claim this, I am signing this object:

@bencolon
bencolon / gist:7f062cb28d7b82cd2038
Created September 29, 2014 13:41
Ember Data "find" methods with cache option
DS.Store.reopen({
/*
Examples :
this.store.findAllCached("user", { for: moment.duration(1, "hours") });
this.store.findAllCached("user", { until: moment().add(1, "hours") });
*/
findAllCached: function(type, options) {
Ember.assert("You need to pass a type to the store's findAllAndCache method", arguments.length >= 1);
Ember.assert("You need to pass a TTL option to the findAllAndCache method (`for` or `until`)",
arguments.length > 1 && (options.for || options.until));