mirror of
https://github.com/penpot/penpot.git
synced 2025-06-05 23:31:38 +02:00
⚡ Performance improvements
This commit is contained in:
parent
814042909a
commit
b576ef02af
16 changed files with 510 additions and 315 deletions
|
@ -213,6 +213,15 @@
|
|||
(mf/set-ref-val! ref value)))
|
||||
(mf/ref-val ref)))
|
||||
|
||||
(defn use-update-var
|
||||
[value]
|
||||
(let [ref (mf/use-var value)]
|
||||
(mf/use-effect
|
||||
(mf/deps value)
|
||||
(fn []
|
||||
(reset! ref value)))
|
||||
ref))
|
||||
|
||||
(defn use-equal-memo
|
||||
[val]
|
||||
(let [ref (mf/use-ref nil)]
|
||||
|
@ -248,3 +257,5 @@
|
|||
(mf/deps focus objects)
|
||||
#(cp/focus-objects objects focus))]
|
||||
objects)))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue