apollo-cache-lite
A lightweight cache implementation for Apollo Client.
Features
- 🚀 Lightweight - Supports the most frequently used use-cases: SSR, extracting cache state, restoring cache state in browser, reading fragments from cache
- 🔥 Fast - Read/write performance is the top priority to make your Apollo app faster
- 🚨 Beta - Use it carefully, it's not production ready yet!
Getting started
- Install with npm or yarn:
npm i --save apollo-cache-lite yarn add apollo-cache-lite
- Import in your app:
;; const client = cache: // other apollo-client options…;
Options
The ApolloCacheLite constructor takes an optional configuration object to customize the cache:
getIdFromObject
A function that takes a data object and returns a unique identifier.
; const cache = { };