modmapper-web/lib/store.ts

26 lines
616 B
TypeScript
Raw Normal View History

2022-02-27 06:17:52 +00:00
import { configureStore, ThunkAction, Action } from "@reduxjs/toolkit"
import plugins from "../slices/plugins"
import pluginsReducer from "../slices/plugins"
import pluginsTxtReducer from "../slices/pluginsTxt"
export function makeStore() {
return configureStore({
reducer: { pluginsTxt: pluginsTxtReducer, plugins: pluginsReducer },
})
}
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