This repository was archived by the owner on May 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { TypedUseSelectorHook , useDispatch , useSelector } from 'react-redux' ;
2
+
3
+ import type { AppDispatch , RootState } from './store' ;
4
+
5
+ export const useAppDispatch : ( ) => AppDispatch = useDispatch ;
6
+
7
+ export const useAppSelector : TypedUseSelectorHook < RootState > = useSelector ;
Original file line number Diff line number Diff line change
1
+ import giftReducer from '../features/gifts/giftSlice' ;
2
+ import recipientReducer from '../features/recipients/recipientSlice' ;
3
+ import { combineReducers } from '@reduxjs/toolkit' ;
4
+
5
+ const rootReducer = combineReducers ( {
6
+ gifts : giftReducer ,
7
+ recipients : recipientReducer ,
8
+ } ) ;
9
+
10
+ export default rootReducer ;
Original file line number Diff line number Diff line change
1
+ import { configureStore } from '@reduxjs/toolkit' ;
2
+
3
+ import rootReducer from './rootReducer' ;
4
+
5
+ const store = configureStore ( {
6
+ reducer : rootReducer ,
7
+ } ) ;
8
+
9
+ export type RootState = ReturnType < typeof store . getState > ;
10
+ export type AppDispatch = typeof store . dispatch ;
11
+
12
+ export default store ;
You can’t perform that action at this time.
0 commit comments