mirror of
https://github.com/penpot/penpot.git
synced 2025-08-03 20:38:33 +02:00
✨ Improve with-atomic macro to accept cfg
This commit is contained in:
parent
d268ff2952
commit
27fb4c7ed9
3 changed files with 22 additions and 2 deletions
|
@ -39,6 +39,20 @@
|
|||
other))]
|
||||
{:node result})))
|
||||
|
||||
(defn penpot-with-atomic
|
||||
[{:keys [node]}]
|
||||
(let [[_ params & other] (:children node)
|
||||
|
||||
result (if (api/vector-node? params)
|
||||
(api/list-node
|
||||
(into [(api/token-node (symbol "clojure.core" "with-open")) params] other))
|
||||
(api/list-node
|
||||
(into [(api/token-node (symbol "clojure.core" "with-open"))
|
||||
(api/vector-node [params params])]
|
||||
other)))
|
||||
|
||||
]
|
||||
{:node result}))
|
||||
|
||||
(defn penpot-defrecord
|
||||
[{:keys [:node]}]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue