Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {compose, createStore} from 'redux';
- import rootReducer from './reducers'
- import persistState from 'redux-localstorage' // +1 line
- const persistedSlices = ['auth', 'constants', 'myStuff']
- const enhancer = compose(
- /* [other middlewares] */,
- persistState(persistedSclices), // +1 line
- )
- const initalState = {}
- const store = createStore(rootReducer, initialState, enhancer)
Add Comment
Please, Sign In to add comment