Created
June 14, 2019 04:14
-
-
Save charly-palencia/91c9a6fcf437323b5ee2bfbd46de7b26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, applyMiddleware, compose } from "redux"; | |
import history from "./history"; | |
import { routerMiddleware } from "connected-react-router"; | |
import thunk from "redux-thunk"; | |
import rootReducer from "./reducers"; | |
const initialState = {}; | |
const enhancers = []; | |
const middleware = [thunk, routerMiddleware(history)]; | |
if (process.env.NODE_ENV === "development") { | |
const devToolsExtension = window.__REDUX_DEVTOOLS_EXTENSION__; | |
if (typeof devToolsExtension === "function") { | |
enhancers.push(devToolsExtension()); | |
} | |
} | |
const composedEnhancers = compose( | |
applyMiddleware(...middleware), | |
...enhancers | |
); | |
export default createStore(rootReducer, initialState, composedEnhancers); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment