0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 08:11:30 -05:00

Add equality check for local mixin for avoid rerenders.

This commit is contained in:
Andrey Antukh 2016-02-25 21:01:28 +02:00
parent dae971a96c
commit 2fed551cf1

View file

@ -119,8 +119,9 @@
(let [local-state (atom initial)
component (:rum/react-component state)]
(add-watch local-state key
(fn [_ _ _ _]
(rum/request-render component)))
(fn [_ _ oldv newv]
(when (not= oldv newv)
(rum/request-render component))))
(assoc state key local-state)))
}))