mirror of
https://github.com/penpot/penpot.git
synced 2025-06-08 19:11:39 +02:00
⚡ Optimize layer-item component
This commit is contained in:
parent
f3b856b2af
commit
0bc468f434
5 changed files with 184 additions and 156 deletions
|
@ -248,16 +248,15 @@
|
|||
(mf/set-ref-val! ref val))
|
||||
(mf/ref-val ref)))
|
||||
|
||||
;; FIXME: rename to use-focus-objects
|
||||
(defn with-focus-objects
|
||||
([objects]
|
||||
(let [focus (mf/deref refs/workspace-focus-selected)]
|
||||
(with-focus-objects objects focus)))
|
||||
|
||||
([objects focus]
|
||||
(let [objects (mf/use-memo
|
||||
(mf/deps focus objects)
|
||||
#(cpf/focus-objects objects focus))]
|
||||
objects)))
|
||||
(mf/with-memo [focus objects]
|
||||
(cpf/focus-objects objects focus))))
|
||||
|
||||
(defn use-debounce
|
||||
[ms value]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue