forked from aeharding/voyager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstore.ts
28 lines (25 loc) · 1.02 KB
/
store.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { configureStore } from "@reduxjs/toolkit";
import postSlice from "./features/post/postSlice";
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
import authSlice from "./features/auth/authSlice";
import commentSlice from "./features/comment/commentSlice";
import communitySlice from "./features/community/communitySlice";
import userSlice from "./features/user/userSlice";
import inboxSlice from "./features/inbox/inboxSlice";
import appearanceSlice from "./features/settings/appearance/appearanceSlice";
const store = configureStore({
reducer: {
post: postSlice,
comment: commentSlice,
auth: authSlice,
community: communitySlice,
user: userSlice,
inbox: inboxSlice,
appearance: appearanceSlice,
},
});
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
export const useAppDispatch: () => AppDispatch = useDispatch;
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
export default store;