Skip to content

Instantly share code, notes, and snippets.

@jamesreggio
Last active December 12, 2017 19:57
Show Gist options
  • Save jamesreggio/05ba26b68f8f6f96712108b832e3c2ee to your computer and use it in GitHub Desktop.
Save jamesreggio/05ba26b68f8f6f96712108b832e3c2ee to your computer and use it in GitHub Desktop.
apollo-cache-persist quickstart example for web
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