18 lines
395 B
TypeScript
18 lines
395 B
TypeScript
|
|
import type { CameraSettings, CameraSettingsAction } from "../../utils/types";
|
||
|
|
|
||
|
|
export const initialState: CameraSettings = {
|
||
|
|
mode: 0,
|
||
|
|
};
|
||
|
|
|
||
|
|
export const cameraSettingsReducer = (state: CameraSettings, action: CameraSettingsAction) => {
|
||
|
|
switch (action.type) {
|
||
|
|
case "SET_MODE":
|
||
|
|
return {
|
||
|
|
...state,
|
||
|
|
mode: action.payload,
|
||
|
|
};
|
||
|
|
default:
|
||
|
|
return state;
|
||
|
|
}
|
||
|
|
};
|