redux-persistate
v1.0.3
Published
Persist redux state to localStorage
Downloads
8
Readme
redux-persistate
Installation
npm i -S redux-persistate
Usage
Save state
import { saveState } from 'redux-persistate'
store.subscribe(() => {
saveState({user : store.getState().user})
})
Load state
import { loadState } from './lib/localStorage'
const defaultState = loadState()
export const store = createStore(rootReducer, defaultState)