This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aws-lambda (3)
- # beginners (27)
- # boot (4)
- # cljs-dev (26)
- # clojure (7)
- # clojure-spec (8)
- # clojure-uk (17)
- # clojurescript (1)
- # core-typed (2)
- # data-science (53)
- # datomic (24)
- # emacs (1)
- # fulcro (7)
- # luminus (1)
- # off-topic (2)
- # onyx (3)
- # pedestal (5)
- # planck (2)
- # portkey (50)
- # re-frame (15)
- # reagent (5)
- # reitit (2)
- # shadow-cljs (19)
- # tools-deps (15)
- # vim (2)
STM is a way of mutating refs, with the ability to rollback transactions, without other threads ever seeing a half-updated state.
Although it is a feature that isn’t used much, it’s more common to store all state in a single mutable place
How do instantiate
class in a var? I have imported
SearchFilter$ContainsSubstring into namespace and I have
(def clazz SearchFilter$ContainsSubstring). How do I instantiate an object from this
clazz var (`new` won't recognize it)?
hello - is it possible to test cljs without compiling to js? it looks like all tutorials use
lein doo phantomjs, but i’d like to just
lein test and test my clojure functions. i’m using re-frame, fwiw - i’ve used the lein re-frame template, which gave me a
doo-tests in it. Is there an easy way to set up lein to run the tests without going all the way to js? Thanks very much in advance!
then it would be no different than what lein test does in a pure jvm project, if configured correctly, yes
i guess that makes sense that that’s the only way to deal with the code without compiling it to js?
there's honestly many ways to do this. clojure.test can be used from a repl directly without using lein or any other build tool
but if you are using lein, making clj test files and using lein test is probably simplest
ok, thanks - it feels a little weird to build a cljs project in cljc just to test the clojure code directly
@hoopes You could test your ClojureScript code using Node.js (if what you are really trying to avoid is spinning up a test browser environment)
true - i use karma and headless chrome with my js now, and i don’t have like a rational reason why i feel like i should be able to test
(fn  (+ 1 1)) without opening chrome (node aside)….you know what i mean? node might be the best bet then
If you are using Cursive, then going the
*.cljc route does have an advantage in that integrated support for testing is better for Clojure than ClojureScript.