You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
744 B
TypeScript
33 lines
744 B
TypeScript
import { createSlice } from '@reduxjs/toolkit';
|
|
|
|
interface IDEContainerState {
|
|
selected?: string;
|
|
menuData?: any[];
|
|
logBarStatus?: boolean;
|
|
}
|
|
|
|
const initialState: IDEContainerState = {
|
|
selected: '',
|
|
menuData: [],
|
|
logBarStatus: false
|
|
};
|
|
|
|
const ideContainerSlice = createSlice({
|
|
name: 'ideContainer',
|
|
initialState,
|
|
reducers: {
|
|
updateSelected(state, action) {
|
|
state.selected = action.payload;
|
|
},
|
|
updateMenuData(state, action) {
|
|
state.menuData = action.payload;
|
|
},
|
|
updateLogBarStatus(state, action) {
|
|
state.logBarStatus = action.payload;
|
|
}
|
|
}
|
|
});
|
|
|
|
export const { updateSelected, updateMenuData, updateLogBarStatus } = ideContainerSlice.actions;
|
|
|
|
export default ideContainerSlice.reducer; |