mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -05:00
🎉 Add cljs optimized get-prop helper macro
This commit is contained in:
parent
f6305db2a8
commit
89a19dec5b
1 changed files with 9 additions and 0 deletions
|
@ -461,6 +461,15 @@
|
|||
(->> (apply c/iteration args)
|
||||
(concat-all)))
|
||||
|
||||
(defmacro get-prop
|
||||
"A macro based, optimized variant of `get` that access the property
|
||||
directly on CLJS, on CLJ works as get."
|
||||
[obj prop]
|
||||
(if (:ns &env)
|
||||
(list (symbol ".") (with-meta obj {:tag 'js}) (symbol (str "-" (c/name prop))))
|
||||
`(c/get ~obj ~prop)))
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Data Parsing / Conversion
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
Loading…
Reference in a new issue