mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
8452e8b777
* Fixed duplication kve bug * Some changes * Add proptypes linting * Fixed proptypes even more * Filename linting
22 lines
551 B
JavaScript
22 lines
551 B
JavaScript
import {createStore, applyMiddleware} from 'redux';
|
|
import thunkMiddleware from 'redux-thunk';
|
|
import {reducer} from './modules';
|
|
|
|
export default function () {
|
|
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(reducer);
|
|
});
|
|
}
|
|
|
|
return store;
|
|
}
|