um-react/src/store.ts

17 lines
542 B
TypeScript
Raw Normal View History

import { PreloadedState, combineReducers, configureStore } from '@reduxjs/toolkit';
import fileListingReducer from './features/file-listing/fileListingSlice';
2023-05-07 22:29:37 +00:00
const rootReducer = combineReducers({
fileListing: fileListingReducer,
2023-05-07 22:29:37 +00:00
});
export const setupStore = (preloadedState?: PreloadedState<RootState>) =>
configureStore({
reducer: rootReducer,
preloadedState,
});
export type RootState = ReturnType<typeof rootReducer>;
export type AppStore = ReturnType<typeof setupStore>;
export type AppDispatch = AppStore['dispatch'];