This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-13
Channels
- # beginners (202)
- # boot (7)
- # cider (14)
- # clara (2)
- # cljs-dev (7)
- # clojure (56)
- # clojure-italy (9)
- # clojure-spec (6)
- # clojure-uk (12)
- # clojurescript (40)
- # core-async (3)
- # datomic (6)
- # duct (1)
- # editors (10)
- # emacs (5)
- # fulcro (24)
- # off-topic (16)
- # onyx (4)
- # pedestal (1)
- # planck (8)
- # portkey (2)
- # re-frame (31)
- # reagent (23)
- # tools-deps (8)
- # vim (3)
Hello. When I try to do
(defn api-loop
[c]
(go
(loop [[payload db] (<! c)]
(doto (js/fetch "" #js {:method "POST" :body payload})
(.then (fn [& response] (cb response))))
(recur (<! c)))))
The clojurescript compiler tryies to get payload
from the "root" namespace scope
Then, when I use clj->js
, it's get the "real" local payload
(defn api-loop
[c]
(go
(loop [[payload db] (<! c)]
(doto (js/fetch "http://localhost:8080/api" (clj->js {:method "POST" :body payload}))
(.then (fn [& response] (cb response))))
(recur (<! c)))))
It's a know issue?looks the same problem https://dev.clojure.org/jira/browse/ASYNC-215