Skip to content

Commit d4f689b

Browse files
author
Andrej Mihajlov
committed
Add local storage support
1 parent 98e6955 commit d4f689b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/client/store.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createStore, applyMiddleware, combineReducers, compose } from 'redux';
22
import { hashHistory } from 'react-router';
33
import { routerMiddleware, routerReducer as routing, push } from 'react-router-redux';
4+
import persistState from 'redux-localstorage';
45
import thunk from 'redux-thunk';
56

67
import user from './reducers/user';
@@ -29,7 +30,7 @@ const composeEnhancers = (() => {
2930
})();
3031

3132
export default function configureStore(initialState) {
32-
const enhancer = composeEnhancers(applyMiddleware(...middlewares));
33+
const enhancer = composeEnhancers(applyMiddleware(...middlewares), persistState());
3334
const rootReducer = combineReducers(reducers);
3435

3536
return createStore(rootReducer, initialState, enhancer);

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"react-router-redux": "^4.0.7",
1616
"redux": "^3.0.0",
1717
"redux-actions": "^1.2.1",
18+
"redux-localstorage": "^0.4.1",
1819
"redux-thunk": "^2.2.0"
1920
},
2021
"devDependencies": {

0 commit comments

Comments
 (0)