18 lines
397 B
TypeScript
18 lines
397 B
TypeScript
|
|
import type { CameraFeedAction, CameraFeedState } from "../../types/types";
|
||
|
|
|
||
|
|
export const initialState: CameraFeedState = {
|
||
|
|
cameraFeedID: "A",
|
||
|
|
};
|
||
|
|
|
||
|
|
export function reducer(state: CameraFeedState, action: CameraFeedAction) {
|
||
|
|
switch (action.type) {
|
||
|
|
case "SET_CAMERA_FEED":
|
||
|
|
return {
|
||
|
|
...state,
|
||
|
|
cameraFeedID: action.payload,
|
||
|
|
};
|
||
|
|
default:
|
||
|
|
return state;
|
||
|
|
}
|
||
|
|
}
|