| 123456789101112131415161718192021222324 | 
							- import { createStore, compose, applyMiddleware } from "redux";
 
- import thunk from "redux-thunk";
 
- import reducers from "./reducers/reducers";
 
- import { saveState } from "./persisted.store.cookies.js";
 
- export default function configureStore(initialState) {
 
- 	const enhancers = compose(typeof window !== "undefined" && window.devToolsExtension ? window.devToolsExtension() : (f) => f);
 
- 	const store = createStore(
 
- 		reducers,
 
- 		applyMiddleware(thunk)
 
- 		// {
 
- 		// 	...initialState,
 
- 		// },
 
- 		// enhancers
 
- 	);
 
- 	// add a listener that will be invoked on any state change
 
- 	store.subscribe(() => {
 
- 		saveState(store.getState());
 
- 	});
 
- 	return store;
 
- }
 
 
  |