2022-08-29 05:19:01 +00:00
|
|
|
import LogRocket from "logrocket"
|
2022-08-30 03:47:15 +00:00
|
|
|
import * as Sentry from "@sentry/react";
|
2022-08-30 02:37:13 +00:00
|
|
|
import { configureStore, ThunkAction, Action } from "@reduxjs/toolkit"
|
2022-02-27 06:17:52 +00:00
|
|
|
|
|
|
|
import pluginsReducer from "../slices/plugins"
|
|
|
|
import pluginsTxtReducer from "../slices/pluginsTxt"
|
2022-03-19 00:08:31 +00:00
|
|
|
import modListFiltersReducer from "../slices/modListFilters"
|
2022-02-27 06:17:52 +00:00
|
|
|
|
2022-08-30 03:47:15 +00:00
|
|
|
const sentryReduxEnhancer = Sentry.createReduxEnhancer();
|
|
|
|
|
2022-02-27 06:17:52 +00:00
|
|
|
export function makeStore() {
|
|
|
|
return configureStore({
|
2022-03-19 00:08:31 +00:00
|
|
|
reducer: { pluginsTxt: pluginsTxtReducer, plugins: pluginsReducer, modListFilters: modListFiltersReducer },
|
2022-08-29 05:19:01 +00:00
|
|
|
middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false }).concat(LogRocket.reduxMiddleware()),
|
2022-08-30 03:47:15 +00:00
|
|
|
enhancers: [sentryReduxEnhancer],
|
2022-02-27 06:17:52 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
const store = makeStore()
|
|
|
|
|
|
|
|
export type AppState = ReturnType<typeof store.getState>
|
|
|
|
|
|
|
|
export type AppDispatch = typeof store.dispatch
|
|
|
|
|
|
|
|
export type AppThunk<ReturnType = void> = ThunkAction<
|
|
|
|
ReturnType,
|
|
|
|
AppState,
|
|
|
|
unknown,
|
|
|
|
Action<string>
|
|
|
|
>
|
|
|
|
|
|
|
|
export default store
|