This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
how do you add the case insensitive flag in clojurescript regex? looking at the source it looks like #"(?i)..." but doesn't seem to work
@afhammad: I ran into the same issue. Ended up going directly to js.
(def rx (js/RegExp. "(o)" "ig")) ;; case insensitive, not greedy
(.split "hellO thereO" rx)
;;=> #js ["hell" "O" " there" "O" ""]
http://stackoverflow.com/questions/23186490/a-case-insensitive-filter-in-clojure-clojurescript
I personally will usually pick the most terse form which is js/RegExp as mikethompson showed
Which Clojurescript libraries occupy the largest % of an advanced compiled JS file? Gzipped app.js is 103KB. How small can you package React and Reagent?
Hm. cljs.core seems to be 263KB unzipped. Any way to shave some bytes off?
@petrus: React is probably bigger than cljs.core. You can't really do better than advanced compilation.
@a.espolov: you don’t have to bind it
(did-mount [this] (.addEventListener js/window “resize” (fn [e] (handle-resize this e)))
I've got a cljs map object that I want to display in hiccup html [:p (str some-map)]
and I need something other than str
because that just returns [object Object]
. Note that some-map
is shallow with simple keys and values. Any suggestions?
@mfikes: double doh! You are correct. My problem wasn't with str
but with the fact that the map was coming from a cursor and freagent treated it differently. Normally it will deref the cursor automagically but in this case I needed to @foo
the thing explicitly.
Cool. (str (clj->js {:a 1 :b 2}))
produces "[object Object]"
and David's suggestion of pr-str
yields nice (`#js`) for that case. Was just curious.
I'm working on an app to provide information about the html environment for developers. Also just exploring the use of freagent, core.async, and Google Closure. https://github.com/decomplect/ing/blob/master/informing/src/app/core.cljs
And a library of Google Closure and core.async stuff: https://github.com/decomplect/ion/blob/master/src/ion/poly/core.cljs