insomnia/app/ui/redux/create.js
Gregory Schier 1cf1037c93 Better Redux (#43)
* Started refactoring redux stores

* Oh God huge refactor here

* Sync contenst updates and nested folders

* Fixed render tests

* A bunch of tweaks
2016-11-16 09:18:39 -08:00

22 lines
587 B
JavaScript

import {createStore, applyMiddleware} from 'redux';
import thunkMiddleware from 'redux-thunk';
import {reducer} from './modules';
export default function configureStore () {
const middleware = [thunkMiddleware];
if (__DEV__) {
// const createLogger = require('redux-logger');
// middleware.push(createLogger({collapsed: true}));
}
const store = createStore(reducer, applyMiddleware(...middleware));
if (__DEV__ && module.hot) {
module.hot.accept('./modules/index', () => {
store.replaceReducer(require('./modules').reducer);
});
}
return store;
}