Skip to content

Commit

Permalink
Store: Mutate store reference in middlewares application (#5229)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Mar 2, 2018
1 parent 6098d12 commit 328a859
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions edit-post/store/middlewares.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ function applyMiddlewares( store ) {
chain = middlewares.map( middleware => middleware( middlewareAPI ) );
enhancedDispatch = flowRight( ...chain )( store.dispatch );

return {
...store,
dispatch: enhancedDispatch,
};
store.dispatch = enhancedDispatch;
return store;
}

export default applyMiddlewares;
6 changes: 2 additions & 4 deletions editor/store/middlewares.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ function applyMiddlewares( store ) {
chain = middlewares.map( middleware => middleware( middlewareAPI ) );
enhancedDispatch = flowRight( ...chain )( store.dispatch );

return {
...store,
dispatch: enhancedDispatch,
};
store.dispatch = enhancedDispatch;
return store;
}

export default applyMiddlewares;

0 comments on commit 328a859

Please sign in to comment.