Skip to content

Commit

Permalink
chore: apply redux devtools via compose (elastic#35326)
Browse files Browse the repository at this point in the history
makes dispatching from devtools trigger other middleware
  • Loading branch information
w33ble committed Apr 19, 2019
1 parent 6d83fc4 commit 52d3471
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions x-pack/plugins/canvas/public/state/middleware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);

0 comments on commit 52d3471

Please sign in to comment.