diff --git a/src/cljs/grub/view/grub.cljs b/src/cljs/grub/view/grub.cljs index 5209824..2398800 100644 --- a/src/cljs/grub/view/grub.cljs +++ b/src/cljs/grub/view/grub.cljs @@ -48,7 +48,8 @@ om/IWillReceiveProps (will-receive-props [this {:keys [text]}] - (om/set-state! owner :grub-text text)) + (when-not (= (om/get-state owner :grub-text) text) + (om/set-state! owner :grub-text text))) om/IRenderState (render-state [_ {:keys [edit-state] :as state}] diff --git a/src/cljs/grub/view/recipe.cljs b/src/cljs/grub/view/recipe.cljs index 3a47cd6..b9fdcd1 100644 --- a/src/cljs/grub/view/recipe.cljs +++ b/src/cljs/grub/view/recipe.cljs @@ -60,9 +60,11 @@ :unmounted false})) om/IWillReceiveProps - (will-receive-props [this next-recipe] - (om/set-state! owner :name (:name next-recipe)) - (om/set-state! owner :grubs (:grubs next-recipe))) + (will-receive-props [this {:keys [name grubs]}] + (when-not (= (om/get-state owner :name) name) + (om/set-state! owner :name name)) + (when-not (= (om/get-state owner :grubs) grubs) + (om/set-state! owner :grubs grubs))) om/IRenderState (render-state [this {:keys [edit-state name grubs]}]