Files
grungnet/src/actions/EditShapeAction.js
Mitchell McCaffrey fa1f6fe18f Converted draw actions storage to collapsed representation
Moved to command pattern for action application
2021-02-04 09:11:27 +11:00

18 lines
372 B
JavaScript

import Action from "./Action";
class EditShapeAction extends Action {
constructor(shapes) {
super();
this.update = (shapesById) => {
for (let edit of shapes) {
if (edit.id in shapesById) {
shapesById[edit.id] = { ...shapesById[edit.id], ...edit };
}
}
return shapesById;
};
}
}
export default EditShapeAction;