2016-07-24 23:52:56 +02:00
|
|
|
import { createStore, applyMiddleware } from "redux";
|
|
|
|
import { hashHistory } from "react-router";
|
|
|
|
import { routerMiddleware } from "react-router-redux";
|
|
|
|
import thunkMiddleware from "redux-thunk";
|
|
|
|
|
|
|
|
import rootReducer from "../reducers";
|
|
|
|
import apiMiddleware from "../middleware/api";
|
|
|
|
|
2016-08-10 21:36:11 +02:00
|
|
|
// Use history
|
2016-07-24 23:52:56 +02:00
|
|
|
const historyMiddleware = routerMiddleware(hashHistory);
|
|
|
|
|
|
|
|
export default function configureStore(preloadedState) {
|
|
|
|
return createStore(
|
|
|
|
rootReducer,
|
|
|
|
preloadedState,
|
|
|
|
applyMiddleware(thunkMiddleware, apiMiddleware, historyMiddleware)
|
|
|
|
);
|
|
|
|
}
|