blob: d7e4a0b47e5cfd3bf0f72f2f4f36685e96c0677f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import {createSlice, PayloadAction} from '@reduxjs/toolkit'
import {App, Page} from "@/models/app.ts"
const initialState = {}
const appSlice = createSlice({
name: 'app',
initialState,
reducers: {
setApp(state, action: PayloadAction<App>) {
console.log("setApp", action.payload)
return action.payload;
},
setPage(state, action: PayloadAction<Page>) {
console.log("setPage.state", state.currentPage, action.payload)
state.currentPage = action.payload;
}
}
})
export const {setApp, setPage} = appSlice.actions;
export default appSlice.reducer
|