Files
BayIQ-UI/src/app/reducers/cameraFeedReducer.ts

23 lines
550 B
TypeScript
Raw Normal View History

import type { CameraFeedAction, CameraFeedState, PaintedCell } from "../../types/types";
export const initialState: CameraFeedState = {
cameraFeedID: "A",
paintedCells: {
A: new Map<string, PaintedCell>(),
B: new Map<string, PaintedCell>(),
C: new Map<string, PaintedCell>(),
},
};
export function reducer(state: CameraFeedState, action: CameraFeedAction) {
switch (action.type) {
case "SET_CAMERA_FEED":
return {
...state,
cameraFeedID: action.payload,
};
default:
return state;
}
}