Last active
December 11, 2017 18:04
-
-
Save jamesreggio/ca187d77ffcea11d2c8142bc514f1d22 to your computer and use it in GitHub Desktop.
apollo-cache-persist quickstart example for React Native
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’; | |
import { AsyncStorage } from ‘react-native’; | |
// Set up your cache. | |
const cache = new InMemoryCache({...}); | |
// Set up cache persistence. | |
persistCache({ | |
cache, | |
storage: AsyncStorage, | |
trigger: 'background', | |
}); | |
// Finish configuring Apollo. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment