2023-05-17 00:46:20 +00:00
|
|
|
import { PreloadedState, combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
|
|
import fileListingReducer from './features/file-listing/fileListingSlice';
|
2023-06-03 13:09:11 +00:00
|
|
|
import settingsReducer from './features/settings/settingsSlice';
|
2023-05-07 22:29:37 +00:00
|
|
|
|
2023-05-17 00:46:20 +00:00
|
|
|
const rootReducer = combineReducers({
|
|
|
|
fileListing: fileListingReducer,
|
2023-06-03 13:09:11 +00:00
|
|
|
settings: settingsReducer,
|
2023-05-07 22:29:37 +00:00
|
|
|
});
|
|
|
|
|
2023-05-17 00:46:20 +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'];
|