Last active
December 12, 2017 19:57
-
-
Save jamesreggio/05ba26b68f8f6f96712108b832e3c2ee to your computer and use it in GitHub Desktop.
apollo-cache-persist quickstart example for web
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 { InMemoryCache } from ‘apollo-cache-inmemory’; | |
import { persistCache } from ‘apollo-cache-persist’; | |
// Set up your cache. | |
const cache = new InMemoryCache({...}); | |
// Set up cache persistence. | |
persistCache({ | |
cache, | |
storage: window.localStorage, | |
}); | |
// Finish configuring Apollo. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment