0.2.1 • Published 8 years ago

relay-cache-manager v0.2.1

Weekly downloads
8
License
MIT
Repository
github
Last release
8 years ago

relay-cache-manager

A CacheManager implementation for local data caching in Relay

Overview

Relay defines the CacheManager interface which lets you write and read records to a local cache. Relay will check the cache first when identifying what data it has/needs; by implementing a CacheManager you can render locally cached data quickly while Relay queries your API and updates the data when the response comes in.

Install

$ npm install --save relay-cache-manager

Usage

Until RelayEnvironment exposes injectCacheManager you have to inject it directly from the RelayStoreData instance used by your store. You can access that via the getStoreData() method on your RelayEnvironment instance. If you're using Relay.Store you can just do:

import CacheManager from 'relay-cache-manager';
const cacheManager = new CacheManager();
Relay.Store.getStoreData().injectCacheManager(cacheManager);
0.2.1

8 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago