Fork me on GitHub
#core-async
<
2018-05-13
>
souenzzo14:05:39

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?

souenzzo14:05:40

usin js-obj also works