This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-15
Channels
- # announcements (8)
- # beginners (65)
- # calva (25)
- # cider (11)
- # clj-kondo (9)
- # cljsrn (14)
- # clojure (103)
- # clojure-europe (15)
- # clojure-greece (1)
- # clojure-italy (28)
- # clojure-nl (39)
- # clojure-spec (9)
- # clojure-uk (28)
- # clojuredesign-podcast (37)
- # clojurescript (56)
- # cursive (41)
- # data-science (10)
- # datomic (25)
- # duct (1)
- # emacs (1)
- # events (3)
- # figwheel-main (7)
- # fulcro (9)
- # graalvm (7)
- # graphql (10)
- # jobs (2)
- # nrepl (17)
- # off-topic (40)
- # quil (12)
- # reitit (11)
- # remote-jobs (5)
- # rum (2)
- # shadow-cljs (387)
- # sql (22)
- # tools-deps (8)
- # vim (26)
- # xtdb (47)
- # yada (9)
i used in react-native with shadow-cljs , it output
ReferenceError: cljs_http is not defined
at eval (eval at <anonymous> (), <anonymous>:1:1)
at eval ()
https://increasinglyfunctional.com/2019/06/25/http-fx-for-re-frame-on-react-native.html
@lepistane could u give an example using fetch, how to print the responese
ohh nicee thanks for the link i will have look 😄 @haiyuan.vinurs
(-> (js/fetch "")
(.then (fn [resp] (.text resp)))
;; u can add .then with prn here
(.catch (fn [arg] (js/console.error arg)))
)
(-> (js/fetch "")
(.then (fn [resp]
(prn (.text resp))))
;; u can add .then with prn here
(.catch (fn [arg] (js/console.error arg)))
)
@lepistane do u can prn the resp?(-> (js/fetch "")
(.then (fn [resp] (.text resp)))
(.then (fn [txt] (println txt)))
(.catch (fn [arg] (js/console.error arg))))
@lepistane i tested this code in react-native, it works, so cljs-http can work in react-native
(ns app.events
(:require [cljs-http.client :as http]
[re-frame.core :as rf]
[cljs.core.async :refer [go <!]]
))
(go (let [response (<! (http/get
""
{:with-credentials? false
:query-params {"since" 135}}
))]
(prn (:status response))
(prn (map :login (:body response)))))
👍 12
@haiyuan.vinurs Glad to see it’s working.
Does anyone use https://github.com/bhauman/react-native-figwheel-bridge and build for production?