Skip to content

Instantly share code, notes, and snippets.

@josemarluedke
Last active May 30, 2020 17:23
Show Gist options
  • Save josemarluedke/d5e5730d140823ba9e19f9a52ff3c4ea to your computer and use it in GitHub Desktop.
Save josemarluedke/d5e5730d140823ba9e19f9a52ff3c4ea to your computer and use it in GitHub Desktop.
import ApolloService from 'ember-apollo-client/services/apollo';
import { persistCache } from 'apollo-cache-persist';
class OverriddenApollo extends ApolloService {
async init() {
await persistCache({
this.cache(),
storage: window.localStorage,
});
super.init(...arguments);
}
cache() {
if (!this._cache) {
this._cache = new InMemoryCache();
}
return this._cache
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment