init commit

This commit is contained in:
zihluwang
2025-03-26 19:06:46 +08:00
commit a46d254148
22 changed files with 3248 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import { createSlice } from "@reduxjs/toolkit"
interface AuthState {
isAuthenticated: boolean
}
const initialState: AuthState = {
isAuthenticated: false
}
const authSlice = createSlice({
name: "auth",
initialState,
reducers: {
}
})
// export const { } = authSlice.actions
export default authSlice.reducer
+16
View File
@@ -0,0 +1,16 @@
import { configureStore } from "@reduxjs/toolkit"
import { useDispatch, useSelector } from "react-redux"
import authReducer from "./auth-slice.ts"
export const store = configureStore({
reducer: {
auth: authReducer,
},
})
export type RootState = ReturnType<typeof store.getState>
export type AppDispatch = typeof store.dispatch
export type AppStore = typeof store
export const useAppDispatch = useDispatch.withTypes<AppDispatch>()
export const useAppSelector = useSelector.withTypes<RootState>()