quarantale/client/src/store.js
2020-03-12 18:37:50 +01:00

23 lines
550 B
JavaScript

import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import rootReducer from './reducers';
const initialState = {};
const middleware = [thunk];
let devTools = window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__();
if (process.env.NODE_ENV === 'test' || process.env.NODE_ENV === 'production' || !devTools) {
devTools = a => a;
}
const store = createStore(
rootReducer,
initialState,
compose(
applyMiddleware(...middleware),
devTools
)
);
export default store;