Skip to content

Commit e26bb23

Browse files
committed
Fix j/call-in
1 parent 966234e commit e26bb23

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/applied_science/js_interop.cljc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
(defmacro let [& body]
1616
`(clojure.core/let ~@body))
1717

18-
(defmacro call-in [obj path & fs]
19-
`(.. ~obj ~@(map #(symbol (str "-" (name %))) path) ~@(map list fs)))
18+
(defmacro call-in [obj path & args]
19+
`(let [parent# (clojure.core/get-in ~obj ~(vec (butlast path)))
20+
f# (clojure.core/get parent# ~(last path))]
21+
(.call f# parent# ~@args)))
2022

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

0 commit comments

Comments
 (0)