feature: add projects page (2 parts works)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import type { PayloadAction } from "@reduxjs/toolkit"
|
||||
|
||||
import { createSlice } from "@reduxjs/toolkit"
|
||||
|
||||
import { AppState } from "./types"
|
||||
|
||||
const initialState: AppState = {
|
||||
currentScreenName: "",
|
||||
}
|
||||
|
||||
const appStateSlice = createSlice({
|
||||
name: "appState",
|
||||
initialState,
|
||||
reducers: {
|
||||
setCurrentScreenName(state, action: PayloadAction<string>) {
|
||||
state.currentScreenName = action.payload
|
||||
},
|
||||
resetAppState(state) {
|
||||
state.currentScreenName = initialState.currentScreenName
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
export const { resetAppState, setCurrentScreenName } = appStateSlice.actions
|
||||
export const appStateReducer = appStateSlice.reducer
|
||||
Reference in New Issue
Block a user