This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-27
Channels
- # announcements (3)
- # babashka (35)
- # babashka-sci-dev (42)
- # beginners (27)
- # calva (7)
- # clj-kondo (18)
- # cljs-dev (1)
- # clojure (40)
- # clojure-europe (141)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (40)
- # clojurescript (15)
- # community-development (4)
- # cursive (54)
- # events (1)
- # fulcro (8)
- # helix (5)
- # hyperfiddle (22)
- # introduce-yourself (6)
- # jobs (3)
- # joyride (26)
- # lsp (7)
- # music (1)
- # nbb (7)
- # off-topic (28)
- # pathom (120)
- # pedestal (3)
- # podcasts-discuss (2)
- # portal (2)
- # rdf (2)
- # releases (20)
- # rewrite-clj (9)
- # shadow-cljs (26)
- # spacemacs (1)
- # sql (13)
- # vim (10)
- # xtdb (63)
What is a good Clojurescript library to call Rest APIs?
I've no professional experience with clojurescript, but this looks promising https://github.com/JulianBirch/cljs-ajax
for example:
(async/go
(let [res (<p! (js/fetch
"/foo"
(clj->js {:opts "here"})))]
(when (= 200 (.. res -status))
(let [body (-> (.. res (json))
(<p!)
(js->clj))]
...)))
I go with axios
and adds a simple wrapper. Anyway, I have to add some simple wrapper to the libs regardless if it is cljs or js.
Big fan of https://funcool.github.io/httpurr/latest/ as it supports both nodejs, browser and java.
Hello, everyone. Is there any way to dynamically mark functions with export metadata using macro during compilation?
I have a configuration file with symbols that should be exported, I plan to read that file with macro and prevent name mangling.
I think this should do what youβre asking π
(defmacro export [& var-names]
(let [var-names (set var-names)]
(doseq [[k v] (ns-publics *ns*)]
(when (contains? var-names k)
(alter-meta! v assoc :export true)))))
Adapted from https://twitter.com/borkdude/status/1526555062365040641?s=20Thanks, I tried alter-meta! approach, It works perfect on clojure side, but on cljs side function meta is unchanged. Not sure what happening.
Ok, now everything works. Thanks again @U022T96EFV3