inital commit
This commit is contained in:
16
src/redux/store.ts
Normal file
16
src/redux/store.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import {configureStore} from '@reduxjs/toolkit';
|
||||
|
||||
import authReducer, {pokemonApi} from 'features/auth/authSlice';
|
||||
import {useDispatch} from "react-redux";
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: {
|
||||
auth: authReducer,
|
||||
[pokemonApi.reducerPath]: pokemonApi.reducer
|
||||
},
|
||||
middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(pokemonApi.middleware)
|
||||
});
|
||||
|
||||
export type RootState = ReturnType<typeof store.getState>;
|
||||
export type AppDispatch = typeof store.dispatch;
|
||||
export const useAppDispatch = () => useDispatch<AppDispatch>();
|
||||
Reference in New Issue
Block a user