ISSUE-011 - Initial Redux work.
Installed reduxjs/toolkit. Added first slice and the basic store for the project.
This commit is contained in:
1 parent
9dd279520a
commit
3add2f3237
7 files changed
+120
-14
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
import { RootState, MenuDimensions } from "../../types/state";
|
||||
|
||||
const initialState: RootState["pageDimensions"] = {
|
||||
menu: {
|
||||
height: 0,
|
||||
},
|
||||
};
|
||||
|
||||
export const pageDimensionsSlice = createSlice({
|
||||
name: "pageDimensions",
|
||||
initialState,
|
||||
reducers: {
|
||||
setMenuDimensions: (state, action: PayloadAction<MenuDimensions>) => {
|
||||
state.menu = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setMenuDimensions } = pageDimensionsSlice.actions;
|
||||
export default pageDimensionsSlice.reducer;
|
||||
Reference in new issue
Block a user