diff --git a/edit-post/store/middlewares.js b/edit-post/store/middlewares.js index 790b6e548786e9..33c748dc9551d4 100644 --- a/edit-post/store/middlewares.js +++ b/edit-post/store/middlewares.js @@ -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; diff --git a/editor/store/middlewares.js b/editor/store/middlewares.js index 4846b7fb8984ae..fd082a4dec3360 100644 --- a/editor/store/middlewares.js +++ b/editor/store/middlewares.js @@ -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;