2019-11-26 10:01:26 +00:00
|
|
|
import rootReducer, { RootState } from "./rootReducer";
|
2020-03-19 22:24:00 +00:00
|
|
|
import { configureStore, Action, getDefaultMiddleware } from "@reduxjs/toolkit";
|
2019-11-26 10:01:26 +00:00
|
|
|
import { ThunkAction } from "redux-thunk";
|
2020-04-03 14:23:03 +00:00
|
|
|
import {
|
|
|
|
mixerMiddleware,
|
|
|
|
mixerKeyboardShortcutsMiddleware,
|
|
|
|
} from "./mixer/state";
|
|
|
|
import { tabSyncMiddleware } from "./optionsMenu/state";
|
2019-11-26 10:01:26 +00:00
|
|
|
|
|
|
|
const store = configureStore({
|
2020-04-03 14:23:03 +00:00
|
|
|
reducer: rootReducer,
|
|
|
|
middleware: [
|
|
|
|
mixerMiddleware,
|
|
|
|
mixerKeyboardShortcutsMiddleware,
|
|
|
|
tabSyncMiddleware,
|
|
|
|
...getDefaultMiddleware(),
|
|
|
|
],
|
2019-11-26 10:01:26 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV === "development" && module.hot) {
|
2020-04-03 14:23:03 +00:00
|
|
|
module.hot.accept("./rootReducer", () => {
|
|
|
|
const newRootReducer = require("./rootReducer").default;
|
|
|
|
store.replaceReducer(newRootReducer);
|
|
|
|
});
|
2019-11-26 10:01:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type AppDispatch = typeof store.dispatch;
|
|
|
|
export type AppThunk = ThunkAction<void, RootState, null, Action<string>>;
|
|
|
|
export default store;
|