Fork me on GitHub

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


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?


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.


Does this behavior sound familiar?


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


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


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


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


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


ah, in this case it would work in clojure also


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?


What do people like to use for manipulating time values?


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


@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


@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


I just used Closures Interval. :import [ 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")))