mirror of
https://git.unlock-music.dev/um/um-react.git
synced 2024-11-24 00:42:16 +00:00
19 lines
636 B
TypeScript
19 lines
636 B
TypeScript
import { PreloadedState, combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
import fileListingReducer from './features/file-listing/fileListingSlice';
|
|
import settingsReducer from './features/settings/settingsSlice';
|
|
|
|
const rootReducer = combineReducers({
|
|
fileListing: fileListingReducer,
|
|
settings: settingsReducer,
|
|
});
|
|
|
|
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'];
|