formatting
This commit is contained in:
@@ -1,29 +1,28 @@
|
||||
import { createSlice, PayloadAction} from "@reduxjs/toolkit";
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||
|
||||
// Типы данных
|
||||
interface StorState {
|
||||
menu: {
|
||||
activePage: string;
|
||||
}
|
||||
menu: {
|
||||
activePage: string;
|
||||
};
|
||||
}
|
||||
|
||||
// Инициализация состояния
|
||||
const initialState: StorState = {
|
||||
menu: {
|
||||
activePage: "",
|
||||
}
|
||||
activePage: '',
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
// Slice
|
||||
const storeSlice = createSlice({
|
||||
name: "store",
|
||||
initialState,
|
||||
reducers: {
|
||||
setMenuActivePage: (state, activePage: PayloadAction<string>) => {
|
||||
state.menu.activePage = activePage.payload;
|
||||
name: 'store',
|
||||
initialState,
|
||||
reducers: {
|
||||
setMenuActivePage: (state, activePage: PayloadAction<string>) => {
|
||||
state.menu.activePage = activePage.payload;
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setMenuActivePage } = storeSlice.actions;
|
||||
|
||||
Reference in New Issue
Block a user