kitchen-simulator
Version:
It is a kitchen simulator (self-contained micro-frontend).
19 lines • 1.88 kB
JavaScript
import { PROJECT_ACTIONS, VIEWER2D_ACTIONS, VIEWER3D_ACTIONS, GROUP_ACTIONS, ITEMS_ACTIONS, HOLE_ACTIONS, LINE_ACTIONS, AREA_ACTIONS, SCENE_ACTIONS, VERTEX_ACTIONS, USER_ACTIONS } from "../constants";
import { KitchenConfiguratorAreasReducer, KitchenConfiguratorHolesReducer, KitchenConfiguratorItemsReducer, KitchenConfiguratorLinesReducer, KitchenConfiguratorGroupsReducer, KitchenConfiguratorProjectReducer, KitchenConfiguratorSceneReducer, KitchenConfiguratorVerticesReducer, KitchenConfiguratorViewer2dReducer, KitchenConfiguratorViewer3dReducer, KitchenConfiguratorUserReducer } from "./export";
import { State } from "../models";
export var initialState = new State();
export default function appReducer(state, action) {
// /////////
if (PROJECT_ACTIONS[action.type]) return KitchenConfiguratorProjectReducer.apply(void 0, arguments);
if (VIEWER2D_ACTIONS[action.type]) return KitchenConfiguratorViewer2dReducer.apply(void 0, arguments);
if (VIEWER3D_ACTIONS[action.type]) return KitchenConfiguratorViewer3dReducer.apply(void 0, arguments);
if (ITEMS_ACTIONS[action.type]) return KitchenConfiguratorItemsReducer.apply(void 0, arguments);
if (HOLE_ACTIONS[action.type]) return KitchenConfiguratorHolesReducer.apply(void 0, arguments);
if (LINE_ACTIONS[action.type]) return KitchenConfiguratorLinesReducer.apply(void 0, arguments);
if (AREA_ACTIONS[action.type]) return KitchenConfiguratorAreasReducer.apply(void 0, arguments);
if (GROUP_ACTIONS[action.type]) return KitchenConfiguratorGroupsReducer.apply(void 0, arguments);
if (SCENE_ACTIONS[action.type]) return KitchenConfiguratorSceneReducer.apply(void 0, arguments);
if (VERTEX_ACTIONS[action.type]) return KitchenConfiguratorVerticesReducer.apply(void 0, arguments);
if (USER_ACTIONS[action.type]) return KitchenConfiguratorUserReducer.apply(void 0, arguments);
return state || initialState;
}