fleet/frontend/redux/store.js
Gabe Hernandez efb35b537a
add prettier and have it format all fleet application code (#625)
* add prettier and have it format all js code except website:
:

* trying running prettier check in CI

* fix runs on in CI

* change CI job name

* fix prettier erros and fix CI
2021-04-12 14:32:25 +01:00

36 lines
1.0 KiB
JavaScript

import { applyMiddleware, compose, createStore } from "redux";
import { browserHistory } from "react-router";
import { loadingBarMiddleware } from "react-redux-loading-bar";
import { routerMiddleware } from "react-router-redux";
import thunkMiddleware from "redux-thunk";
import authMiddleware from "./middlewares/auth";
import redirectMiddleware from "./middlewares/redirect";
import reducers from "./reducers";
const initialState = {};
const appliedMiddleware = applyMiddleware(
thunkMiddleware,
routerMiddleware(browserHistory),
authMiddleware,
redirectMiddleware,
loadingBarMiddleware({
promiseTypeSuffixes: ["REQUEST", "SUCCESS", "FAILURE"],
})
);
const composeEnhancers =
process.env.NODE_ENV !== "production" &&
typeof global.window === "object" &&
global.window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? global.window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
: compose;
const store = createStore(
reducers,
initialState,
composeEnhancers(appliedMiddleware)
);
export default store;