@wora/relay-store
TypeScript icon, indicating that this package has built-in type declarations

7.0.0 • Public • Published

@wora/relay-store

Installation

Install @wora/relay-store using yarn or npm:

yarn add @wora/relay-store

Examples

import { RecordSource, Store } from '@wora/relay-store';
import { CacheOptions } from "@wora/cache-persist";
import { Environment } from 'relay-runtime';

const defaultTTL: number = 10 * 60 * 1000; // optional, default
const persistOptions: CacheOptions = { defaultTTL }; // optional, default
const persistOptionsRecords: CacheOptions = {}; // optional, default
const recordSource = new RecordSource(persistOptionsRecords);
const store = new Store(recordSource, persistOptions);
const environment = new Environment({network, store});

// ...

await store.hydrate();

Documentation

Follow the link: Relay Store Documentation

Package Sidebar

Install

npm i @wora/relay-store

Weekly Downloads

615

Version

7.0.0

License

MIT

Unpacked Size

33.4 kB

Total Files

23

Last publish

Collaborators

  • morrys