Skip to content

Commit

Permalink
Improve js-interop stub
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Nov 17, 2023
1 parent 2da3d79 commit 0126bf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ public/test
out
dist
**/.DS_Store
.nrepl-port
4 changes: 2 additions & 2 deletions src-squint/applied_science/js_interop.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
(defmacro call-in [obj path & fs]
`(.. ~obj ~@(map #(symbol (str "-" %)) path) ~@(map list fs)))

(defmacro call [obj f]
(list (symbol (str "." f)) obj))
(defmacro call [obj f & args]
(list* (symbol (str "." (name f))) obj args))

(defmacro !set [obj k v]
`(do (cljs.core/set! ~(list (symbol (str ".-" (name k))) obj) ~v)
Expand Down

0 comments on commit 0126bf0

Please sign in to comment.