Last active
May 30, 2020 17:23
-
-
Save josemarluedke/d5e5730d140823ba9e19f9a52ff3c4ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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