You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/frontend/src/Store/Middleware/middlewares.js

26 lines
753 B

import { routerMiddleware } from 'connected-react-router';
import { applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import createPersistState from './createPersistState';
import createSentryMiddleware from './createSentryMiddleware';
export default function(history) {
const middlewares = [];
const sentryMiddleware = createSentryMiddleware();
if (sentryMiddleware) {
middlewares.push(sentryMiddleware);
}
middlewares.push(routerMiddleware(history));
middlewares.push(thunk);
// eslint-disable-next-line no-underscore-dangle
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
return composeEnhancers(
applyMiddleware(...middlewares),
createPersistState()
);
}