mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-26 03:23:55 +03:00
c924091e8c
* Rename redux-slider-monitor to redux-devtools-slider-monitor * Fix
20 lines
569 B
JavaScript
20 lines
569 B
JavaScript
import { createStore, compose } from 'redux';
|
|
import { persistState } from 'redux-devtools';
|
|
import rootReducer from '../reducers';
|
|
import DevTools from '../containers/DevTools';
|
|
|
|
const finalCreateStore = compose(
|
|
DevTools.instrument(),
|
|
persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/))
|
|
)(createStore);
|
|
|
|
export default function configureStore(initialState) {
|
|
const store = finalCreateStore(rootReducer, initialState);
|
|
|
|
if (module.hot) {
|
|
module.hot.accept('../reducers', () => store.replaceReducer(rootReducer));
|
|
}
|
|
|
|
return store;
|
|
}
|