Phyks (Lucas Verney)
fffe9c4cd3
Major code review, cleaning the code and adding a lot of comments. Also implements a separate store to keep entities with a reference count and garbage collection. This closes #15. Known issues at the moment are: * Webplayer is no longer working, it has to be refactored. * AlbumPage is to be implemented.
19 lines
567 B
JavaScript
19 lines
567 B
JavaScript
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";
|
|
|
|
// Use history
|
|
const historyMiddleware = routerMiddleware(hashHistory);
|
|
|
|
export default function configureStore(preloadedState) {
|
|
return createStore(
|
|
rootReducer,
|
|
preloadedState,
|
|
applyMiddleware(thunkMiddleware, apiMiddleware, historyMiddleware)
|
|
);
|
|
}
|