From 89a21d7abb6948df5f14822bb54551af2ac49cde Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sat, 9 Apr 2016 23:14:21 +0300 Subject: [PATCH] Add update-shape event just for shape inplace update. --- src/uxbox/data/shapes.cljs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/uxbox/data/shapes.cljs b/src/uxbox/data/shapes.cljs index b552a6883..474a078b7 100644 --- a/src/uxbox/data/shapes.cljs +++ b/src/uxbox/data/shapes.cljs @@ -94,6 +94,14 @@ (let [shape (get-in state [:shapes-by-id id])] (stsh/dissoc-shape state shape))))) +(defn update-shape + "Just updates in place the shape." + [{:keys [id] :as shape}] + (reify + rs/UpdateEvent + (-apply-update [_ state] + (update-in state [:shapes-by-id id] merge shape)))) + (defn move-shape "Mark a shape selected for drawing in the canvas." [sid delta]