init commit
This commit is contained in:
@@ -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
|
||||
@@ -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>()
|
||||
Reference in New Issue
Block a user