modmapper-web/lib/store.ts

27 lines
770 B
TypeScript
Raw Normal View History

2022-02-27 06:17:52 +00:00
import { configureStore, ThunkAction, Action } from "@reduxjs/toolkit"
import pluginsReducer from "../slices/plugins"
import pluginsTxtReducer from "../slices/pluginsTxt"
import modListFiltersReducer from "../slices/modListFilters"
2022-02-27 06:17:52 +00:00
export function makeStore() {
return configureStore({
reducer: { pluginsTxt: pluginsTxtReducer, plugins: pluginsReducer, modListFilters: modListFiltersReducer },
2022-03-04 03:11:40 +00:00
middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false }),
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