3.0.1 • Published 8 years ago
redux-replicate-memory v3.0.1
redux-replicate-memory
Replicator for redux-replicate
designed to synchronously persist the state of redux
stores in memory. Useful for universal rendering of replicator query results and optimistic queries.
Table of contents
Installation
npm install redux-replicate-memory --save
Usage
Use with redux-replicate
.
Example using react-redux-provide
// src/replication.js
import memory from 'redux-replicate-memory';
import { theme } from './providers/index';
theme.replication = {
reducerKeys: ['themeName'],
replicator: memory
};
Example using compose
import { createStore, combineReducers, compose } from 'redux';
import replicate from 'redux-replicate';
import memory from 'redux-replicate-memory';
import reducers from './reducers';
const initialState = {
wow: 'such storage',
very: 'cool'
};
const key = 'superCoolStorageUnit';
const reducerKeys = true;
const replicator = memory;
const replication = replicate({ key, reducerKeys, replicator });
const create = compose(replication)(createStore);
const store = create(combineReducers(reducers), initialState);
3.0.1
8 years ago
3.0.0
8 years ago
2.0.0-alpha.4
8 years ago
2.0.0-alpha.3
8 years ago
2.0.0-alpha.2
8 years ago
2.0.0-alpha.1
8 years ago