11import { compose , createStore , applyMiddleware } from 'redux' ;
22import thunk from 'redux-thunk' ;
33import rootReducer from 'reducers' ;
4- import persistState from 'redux-localstorage' ;
54import DevTools from 'containers/DevTools' ;
65
7- /* localStorage Persisted States
8- * Set up persisted state properties via localStorage. They should be added
9- * by their property name of the piece of state you want to persist, e.g:
10- * const persistedStates = ['session', 'order'];
11- */
12- const persistedStates = [ ] ;
13-
14- export default function configureStore ( initialState , localStorage = true ) {
6+ export default function configureStore ( initialState ) {
157 /* Middleware
168 * Configure this array with the middleware that you want included. thunk
179 * is included by default, and react-router-redux's syncHistory is also
@@ -24,13 +16,6 @@ export default function configureStore(initialState, localStorage = true) {
2416 DevTools . instrument ( )
2517 ] ;
2618
27- // Client-side enhancers and middleware
28- if ( isBrowser ( ) ) {
29- if ( localStorage ) {
30- enhancers . push ( persistState ( persistedStates ) ) ;
31- }
32- }
33-
3419 const enhancer = compose ( ...[
3520 applyMiddleware ( ...middleware ) ,
3621 ...enhancers
@@ -49,7 +34,3 @@ export default function configureStore(initialState, localStorage = true) {
4934
5035 return store ;
5136}
52-
53- function isBrowser ( ) {
54- return ( typeof window !== 'undefined' && typeof window . document !== 'undefined' ) ;
55- }
0 commit comments