From cf7f71a892d0bfd8b22b5619e92303ec4891d2e7 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Fri, 19 Apr 2019 12:21:03 -0700 Subject: [PATCH] chore: apply redux devtools via compose (#35326) makes dispatching from devtools trigger other middleware --- x-pack/plugins/canvas/public/state/middleware/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/canvas/public/state/middleware/index.js b/x-pack/plugins/canvas/public/state/middleware/index.js index 25933b851ba9f..88481c4682eb8 100644 --- a/x-pack/plugins/canvas/public/state/middleware/index.js +++ b/x-pack/plugins/canvas/public/state/middleware/index.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { applyMiddleware, compose } from 'redux'; +import { applyMiddleware, compose as reduxCompose } from 'redux'; import thunkMiddleware from 'redux-thunk'; import { getWindow } from '../../lib/get_window'; import { breadcrumbs } from './breadcrumbs'; @@ -34,9 +34,7 @@ const middlewares = [ ), ]; -// initialize redux devtools if extension is installed -if (getWindow().__REDUX_DEVTOOLS_EXTENSION__) { - middlewares.push(getWindow().__REDUX_DEVTOOLS_EXTENSION__()); -} +// compose with redux devtools, if extension is installed +const compose = getWindow().__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || reduxCompose; export const middleware = compose(...middlewares);