ISSUE-032 - Progress checkpoint. Have a working "selectedCars" modifying component named GridSelection.
Have a work-in-progress AngledFlag prototype controller that relying on a central state property in the Workspaces portion of the store. It's a bit hacky. But it made me realize that my desire to do silly things with extending interfaces won't work that way I'm going to need to rely on them in the future. I cannot demand more specific data from a state that uses a less specific interface. Rookie mistake. I am also at the mercy of a design flaw when it comes to using React Hooks: The way I organize Workspaces makes React very angry. When I switch between workspaces that rely on hooks to render correctly the whole thing explodes. I believe I need to use components directly to correctly unmount - instead of the very hacky switch statement I have in the form of fetchBroadcastGraphic(). I might need to try seeing if ReactRouter can provide my solution.
This commit is contained in:
1 parent
5d009a3d70
commit
e676c7a95a
17 files changed
+247
-33
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import { RootState, WorkspaceId, WorkspaceProperties } from "../../types/state";
|
||||
import { PrototypeState, RootState, WorkspaceId, WorkspaceProperties } from "../../types/state";
|
||||
|
||||
const initialState: RootState["workspace"] = {
|
||||
workspaceId: "",
|
||||
@@ -9,6 +9,7 @@ const initialState: RootState["workspace"] = {
|
||||
overlayIds: [],
|
||||
previewWindowDimensions: { width: 0, height: 0 },
|
||||
},
|
||||
prototypeState: null,
|
||||
};
|
||||
|
||||
export type UpdateWorkspaceAction = {
|
||||
@@ -30,6 +31,9 @@ export const workspaceSlice = createSlice({
|
||||
state.workspaceId = action.payload.workspaceId;
|
||||
state.workspaceProperties = action.payload.workspaceProperties;
|
||||
},
|
||||
setPrototypeState: (state, action: PayloadAction<PrototypeState>) => {
|
||||
state.prototypeState = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -37,5 +41,6 @@ export const {
|
||||
setWorkspaceId,
|
||||
setAnimatedBG,
|
||||
updateWorkspace,
|
||||
setPrototypeState,
|
||||
} = workspaceSlice.actions;
|
||||
export default workspaceSlice.reducer;
|
||||
Reference in new issue
Block a user