Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/create-apollo-client / src / cache / apolloCache.ts
Size: Mime:
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