Repository URL to install this package:
|
Version:
0.2.0 ▾
|
import { InMemoryCache } from 'apollo-cache-inmemory'
/**
* @api @see https://github.com/apollographql/apollo-cache-persist#react
* @api @see https://www.apollographql.com/docs/react/features/cache-updates.html#normalization
* @todo freeze @@perf
*/
const inMemoryCache = new InMemoryCache()
const cache = inMemoryCache
// const IS_BROWSER = typeof window === 'object'
// const HYDRATABLE_APOLLO_STATE = IS_BROWSER && (window as any).__APOLLO_STATE__
// const cache = IS_BROWSER && !!HYDRATABLE_APOLLO_STATE
// ? inMemoryCache.restore(HYDRATABLE_APOLLO_STATE)
// : inMemoryCache
export { cache }
export default cache