Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Commit

Permalink
Merge pull request #19 from rocjs/fix/memory-leak
Browse files Browse the repository at this point in the history
Solved a memory leak on the server
  • Loading branch information
andreasrs committed Jun 2, 2016
2 parents 80832bd + 6037219 commit 286528b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ export default function createReduxStore(reducers, ...middlewares) {
return (callback) =>
(history, initialState) => {
let finalCreateStore;
const normalMiddlewares = [].concat(middlewares);

// Add the react-router-redux middleware
middlewares.push(routerMiddleware(history));
normalMiddlewares.push(routerMiddleware(history));

if (__DEV__ && __WEB__) {
const { persistState } = require('redux-devtools');
Expand All @@ -42,13 +43,13 @@ export default function createReduxStore(reducers, ...middlewares) {
: require('../../client/dev-tools').default.instrument();

finalCreateStore = compose(
applyMiddleware(...middlewares, ...debugMiddlewares),
applyMiddleware(...normalMiddlewares, ...debugMiddlewares),
devTools,
persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/))
)(createStore);
} else {
finalCreateStore = compose(
applyMiddleware(...middlewares)
applyMiddleware(...normalMiddlewares)
)(createStore);
}

Expand Down

0 comments on commit 286528b

Please sign in to comment.