forked from Memmy-App/memmy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
store.ts
31 lines (27 loc) · 1.14 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
29
30
31
import { configureStore } from "@reduxjs/toolkit";
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
import { postSlice } from "./slices/post/postSlice";
import { newCommentSlice } from "./slices/newComment/newCommentSlice";
import feedSlice from "./slices/feed/feedSlice";
import communitiesSlice from "./slices/communities/communitiesSlice";
import settingsSlice from "./slices/settings/settingsSlice";
import accountsSlice from "./slices/accounts/accountsSlice";
import bookmarksSlice from "./slices/bookmarks/bookmarksSlice";
import siteSlice from "./slices/site/siteSlice";
const store = configureStore({
reducer: {
post: postSlice.reducer,
newComment: newCommentSlice.reducer,
feed: feedSlice,
communities: communitiesSlice,
settings: settingsSlice,
accounts: accountsSlice,
bookmarks: bookmarksSlice,
site: siteSlice,
},
});
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;