This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-01
Channels
- # atom-editor (11)
- # babashka (25)
- # beginners (142)
- # boot (9)
- # calva (3)
- # cider (19)
- # clara (15)
- # clj-kondo (6)
- # cljs-dev (20)
- # clojars (11)
- # clojure (164)
- # clojure-dev (9)
- # clojure-europe (6)
- # clojure-italy (17)
- # clojure-nl (3)
- # clojure-spec (19)
- # clojure-sweden (10)
- # clojure-uk (23)
- # clojurescript (34)
- # code-reviews (31)
- # conjure (20)
- # cursive (14)
- # datomic (54)
- # emacs (1)
- # fulcro (51)
- # graalvm (24)
- # graphql (6)
- # helix (3)
- # jobs (3)
- # kaocha (1)
- # malli (2)
- # meander (15)
- # off-topic (81)
- # pathom (2)
- # re-frame (43)
- # reagent (26)
- # reitit (1)
- # releases (1)
- # sci (12)
- # shadow-cljs (29)
- # sql (22)
- # timbre (3)
- # tools-deps (15)
yep. you can easily measure such things:
(defrecord MyRec [a])
(let [a {:a 5}
b (->MyRec 5)]
(time
(dotimes [i 1e7]
(:a a)))
(println "record:")
(time
(dotimes [i 1e7]
(:a b)))
)
"Elapsed time: 267.300000 msecs"
record:
"Elapsed time: 10.745000 msecs"you can view the compiled js to understand why: http://app.klipse.tech/
when testing a value such as a map for IEquiv
- it looks like the hash values are ignored. is that correct, and if so, why?
(i'd assumed that the hash
property of values was a quick way to check equivalence, but looks like they don't take part, really curious what's going on)
hash can be a good fail fast option so it makes sense in that sense
(and identity can be a good pass fast option)
but to truly test deep equality, you can have to check values
thanks for the info both, really interesting. is it the same in CLJ or is this a CLJS quirk?
I'm thinking of doing some live coding of some OSS ClojureScript I'm working on. if people want to tune in and hang out I thought that might be fun π anyone interested?
Why this is always printing even when the class is not available:
(when-let [elms (gdom/getElementsByClass "navbar-burger")]
(.log js/console elms))))
@somedude314 that should always return a list
even if itβs empty, it should be a NodesList array
an object, even empty, is a true value
It defaults to document: https://github.com/google/closure-library/blob/master/closure/goog/dom/dom.js#L261
i'm sorry. i was looking at https://google.github.io/closure-library/api/goog.dom.html and i must have gotten the wrong one. i thought its signature was element classname
Anyone using tools-deps + cljs-test-runner w/ node + jsdom for CLJS tests? Having a hard time getting it working.
anyone trying clojurescript + figwheel-main + implementing client side routing using reitit?