introducing redux and fixing stuff

This commit is contained in:
2022-03-23 01:53:45 +01:00
parent c6bef04c73
commit 66a61d4cf9
29 changed files with 567 additions and 188 deletions

17
assets/src/app/store.ts Normal file
View File

@@ -0,0 +1,17 @@
import { configureStore } from "@reduxjs/toolkit";
import AuthReducer from "../features/auth/auth-slice";
import {cardDeckApiSlice} from "../features/cardDecks/cardDeck-api-slice";
export const store = configureStore({
reducer: {
auth: AuthReducer,
[cardDeckApiSlice.reducerPath]: cardDeckApiSlice.reducer
},
middleware: (getDefaultMiddleware) => {
return getDefaultMiddleware().concat(cardDeckApiSlice.middleware);
}
});
export type AppDispatch = typeof store.dispatch;
export type RootState = ReturnType<typeof store.getState>;