💄 Minor cosmetic change on frame memo equals func.

This commit is contained in:
Andrey Antukh 2020-04-10 14:31:24 +02:00 committed by Alonso Torres
parent 7db2db96e1
commit d007bdf813

View file

@ -31,11 +31,8 @@
(declare frame-shape)
(declare translate-to-frame)
(defn wrap-memo-frame
([component]
(mf/memo'
component
(fn [np op]
(defn frame-wrapper-memo-equals?
[np op]
(let [n-shape (aget np "shape")
o-shape (aget op "shape")
n-objs (aget np "objects")
@ -50,13 +47,12 @@
(if (identical? (get n-objs id)
(get o-objs id))
(recur (first ids) (rest ids))
false)))))))))
false))))))
(defn frame-wrapper
[shape-wrapper]
(mf/fnc frame-wrapper
{::mf/wrap [wrap-memo-frame]}
{::mf/wrap [#(mf/memo' % frame-wrapper-memo-equals?)]}
[{:keys [shape objects] :as props}]
(let [selected-iref (-> (mf/deps (:id shape))
(mf/use-memo #(refs/make-selected (:id shape))))