Fork me on GitHub
#clojurescript
<
2016-03-08
>
smw07:03:47

Is using cemerick.piggieback to start your cljs repl inside your clojure repl deprecated somehow? Considered bad practice?

mattyulrich10:03:04

I've been having a lot of trouble with cljs-ajax. I assume that it's something to do with cljs-ajax being both a clj and cljs lib and I have something off in my env - though I am new to all of this and may just be wildly misunderstanding. However, it seems like if I require the lib :as ajax, figwheel quietly fails and builds nothing. When I comment out the :require, it builds again. If I :refer ajax-request I can sometimes get it to work but not consistently. Is there something I need in my project to tell cljsbuild/figwheel to ignore the clj components or should that just be working out of the box?

mattyulrich13:03:26

Ok - I think I must be missing some fundamental understanding. At this point in time, if I require anything new, both my cljsbuild and figwheel builds end up using some old (like many versions ago) copy of my cljs. If I remove the new require and make a change, that is picked up appropriately.

mattyulrich13:03:34

Does this behavior sound familiar?

mmeix13:03:49

Support for (.log2 js/Math ...) seems not to be very good - should I use something from goog instead?

mmeix13:03:43

of course one could do #(/ (.log js/Math %) (.LN2 js/Math)) - so just asking for the best way

cky13:03:34

@mmeix: MDN seems to say that Math.log2 is new to ES6.

cky13:03:08

so using (.-LN2 js/Math) is probably the best way.

mfikes16:03:26

@mmeix: Math is a convenience pseudo-namespace, so your expression could be written as #(/ (Math/log %) Math/LN2)

mmeix16:03:03

ah, in this case it would work in clojure also

jjttjj21:03:35

I'm starting to read up a bunch on transit, but just in case i'm missing something, is there an easy way that i'm missing to get joda.time.Intervals into clojurescript using transit?

futuro22:03:10

What do people like to use for manipulating time values?

dnolen22:03:51

@jjttjj: it’s not hard to add extension types with transit

dnolen22:03:28

@futuro: Google Closure Library has a bunch of stuff - there’s also cljs-time (which builds over GCL) but I haven’t used that in anger so I can’t say much more about it

futuro22:03:37

@dnolen: Yeah, I was leaning towards cljs-time because I like to try out the cljs libs before moving to js interop; thanks for the input

michaellopez22:03:05

I just used Closures Interval. :import [goog.date Interval] then (swap! data assoc :length (let [me (Interval.fromIsoString updlength)] (str (if (> me.hours 0) (str me.hours "h ") ) me.minutes "m " me.seconds "s")))