15 lines
483 B
TypeScript
15 lines
483 B
TypeScript
import { configureStore } from "@reduxjs/toolkit";
|
|
import filesReducer from "./slices/fileSlice";
|
|
import { useDispatch, useSelector } from "react-redux";
|
|
|
|
export const store = configureStore({
|
|
reducer: {
|
|
files: filesReducer,
|
|
},
|
|
});
|
|
|
|
export type RootState = ReturnType<typeof store.getState>;
|
|
export type AppDispatch = typeof store.dispatch;
|
|
export const useAppDispatch = useDispatch.withTypes<AppDispatch>();
|
|
export const useAppSelector = useSelector.withTypes<RootState>();
|