forked from Memmy-App/memmy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
store.ts
33 lines (29 loc) · 1.24 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
32
33
import { configureStore } from "@reduxjs/toolkit";
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
import { postSlice } from "./src/slices/post/postSlice";
import { newCommentSlice } from "./src/slices/comments/newCommentSlice";
import feedSlice from "./src/slices/feed/feedSlice";
import settingsSlice from "./src/slices/settings/settingsSlice";
import accountsSlice from "./src/slices/accounts/accountsSlice";
import siteSlice from "./src/slices/site/siteSlice";
import toastSlice from "./src/slices/toast/toastSlice";
import editCommentSlice from "./src/slices/comments/editCommentSlice";
import favoritesSlice from "./src/slices/favorites/favoritesSlice";
const store = configureStore({
reducer: {
post: postSlice.reducer,
newComment: newCommentSlice.reducer,
feed: feedSlice,
settings: settingsSlice,
accounts: accountsSlice,
site: siteSlice,
toast: toastSlice,
editComment: editCommentSlice,
favorites: favoritesSlice,
},
});
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;