UNPKG

react-planner

Version:

react-planner is a React Component for plans design. Draw a 2D floorplan and navigate it in 3D mode.

23 lines (18 loc) 633 B
import { BEGIN_DRAGGING_VERTEX, UPDATE_DRAGGING_VERTEX, END_DRAGGING_VERTEX } from '../constants'; import { Vertex } from '../class/export'; export default function (state, action) { switch (action.type) { case BEGIN_DRAGGING_VERTEX: return Vertex.beginDraggingVertex( state, action.layerID, action.vertexID, action.x, action.y ).updatedState; case UPDATE_DRAGGING_VERTEX: return Vertex.updateDraggingVertex( state, action.x, action.y ).updatedState; case END_DRAGGING_VERTEX: return Vertex.endDraggingVertex( state, action.x, action.y ).updatedState; default: return state; } }