This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-09
Channels
- # announcements (4)
- # babashka (2)
- # beginners (8)
- # calva (2)
- # chlorine-clover (7)
- # cider (3)
- # clj-kondo (1)
- # cljs-dev (2)
- # clojure (21)
- # clojure-dev (2)
- # clojure-europe (5)
- # clojure-spec (17)
- # clojuredesign-podcast (7)
- # clojurescript (8)
- # conjure (4)
- # cursive (3)
- # datomic (1)
- # defnpodcast (5)
- # esprit (51)
- # fulcro (7)
- # jobs (1)
- # luminus (3)
- # news-and-articles (1)
- # off-topic (2)
- # other-lisps (3)
- # pathom (8)
- # portal (3)
- # re-frame (3)
- # re-ops (1)
- # shadow-cljs (26)
- # testing (15)
- # tools-deps (34)
- # xtdb (1)
how does one turn something like this into cljs?
var foo = new Foo("input", (e) => { if (e) return; foo.bar(); });
maybe something like this?
(let [foo (atom nil)]
(reset! foo (new js/Foo "input" #(if-not e (.bar @foo)))))
I'd probably do:
(let [foo (js/Foo. "input" #(when-not % (.bar foo)))]
;; use `foo` here
)
not sure if it’s something i’m doing wrong or if it’s actually not working, but says my “foo” is undefined