Fork me on GitHub

how did you find out about this?


just ran across it at some point… seemed pretty cool


i don’t think the dash is clojurescript though, looks like a standard ruby/js thing. reimann itself is written in clojure though.


Hi all I want to use apply and (.log js/console) together I want the code to have the same effect as console.log("hello" "world"); but this doesn't work (apply (.-log js/console) "hello" "world") any ideas?


to make my code easier to understand I want to avoid (.log js/console "hello" "world" ...)


in om, is it a bad idea to keep my textarea state in local state?


i'm trying to implement editing posts, and i stored the edit-text in localstate. I instantiate the local state with the text of the current post that should be edited. however if someone clicks another posts (client side routing), the edit box now has the text of the initial post instead of the new post. (also I store whether or not a post is being edited in localstate as well, so when I click a new post it still thinks im editing a post even though its a different post)


do you guys have a better way of doing this, i'll have to do quite a bit of work to refactor the textarea text so that its stored in app-state instead of localstate


@stuartmitchell: so what you are saying is that this works: (js/console.log "a" "b") But this does not: (apply js/console.log ["a" "b"]) In effect, js/console.log does not behave as a higher order function


I have no solution, but i wanted to clarify your question (I've seen others run into this issue, but I don't remember the solutuon -- or if there was one)


@stuartmitchell: pretty sure this works so maybe you can find something useful in its study:


thanks @jackjames (.apply (.-log js/console) js/console (clj->js ["hello""world"])) works


creating console helpers with defn is problematic if you care about source line numbers being reported correctly. for example calling the mlog function @jackjames linked will produce link to line 55 in that file in the console. the cljs println shares the same problem. when i call it it reports core.js line 100. shodan does not have this problem since it uses macros. as a result the correct line number as to where you called log in your source will be reported.


again this is only important if you care about it. personally, i care a great deal about accuracy when i'm debugging which is why i no longer wrap the console API with functions.


i am new to transit.cljs. What do i need to do, to transit a (t/write transit-writer {:date (Date.) }) do i need a handler?


because this should be a default mapping - why is this code not working? I get the Error: "can not write"


ok i understand - because it is a, i need a handler. Found some info here:


@thomasdeutsch: the transit-cljs wiki explains how to do this.


@dnolen: I’ve found some inconsistency in cljs.core/multi-arity-fn. The :arglists in :top-fn meta is a bit different to single arity/variadic.


Not sure if it’s a bug, or which is correct behaviour


But cljs.core/multi-arity-fn produces :top-fn {:arglists ([x] [x y] [x y z])…} and it seems the others produce :arglists (quote ([x] [x y] [x y z])).


@dnolen: I can submit a ticket/patch… Is the behaviour for multi-arity-fn incorrect?


@noprompt: You might also like my logging library: . It uses macros a lot and reports local binding and line number etc.


@andrewmcveigh: sure but I would check there isn't one already.


@dnolen: I’ve had a look, there are a couple of issues about the same/similar thing. Both closed… seem to be kind of the same issue, but not dealing with multi-arity-fn. I’ll double check before submitting anything.


What difference is there between a :require of a Google Closure class like [goog.dom.ViewportSizeMonitor] versus an (:import [goog.dom ViewportSizeMonitor]?


@hmadelaine: I still have a few points of confusion. Before that, the EventType/ACTION misuse of the slash was a great tip.


In your example of (:import goog.Uri) how are you then able to reference it as simply (Uri.) with no namespace prefix? Or is goog not a namespace prefix in this context? Or is something magical happening?


In my example would there be any difference between these two forms:

(:import [goog.dom.ViewportSizeMonitor])
(:import [goog.dom ViewportSizeMonitor])
(dot versus space)


Just tried it and they are different.


Another thing I've only recently come to realize is that the :as option creates an alias in the current namespace in addition to the fully qualified library name, which is a bit different than, say, imports in python.


I've also seen code in the wild using (:require [goog.dom.ViewportSizeMonitor :as viewport-size]) which seems really confusing in this context.

Petrus Theron16:06:32

has anyone used mixpanel tracking from cljs? As I understand it, I just need to set up some externs.


Hi everyone


Have anybody deployed clojurescript in


@wiruzx: I haven't done it, but I'm familiar with tenzing, which is a boot tool, which lists as a target


@martinklepsch: care to answer a question?


@meow: thanks for the answer. I cannot find any information about usage tenzing with Parse. And I don't really want to add one more abstraction layer


One more question: How to remove #!/usr/bin/env node hashbang?

:cljsbuild {:builds [{
                        :compiler {:output-to "resources/public/js/main.js"
                                   :target :nodejs
                                   :hashbang false}}]})
Doesn't work =(


Is there a resource somewhere that explains exactly what type hints accomplish (if at all) in cljs?


@rauh: there's a lot of cool stuff in there. i'll check it out more when i have a chance.


@wiruzx: Travis Vachon did a presentation on clojurescript with Parse at Clojure/West 2014 -


@meow: you have to realize that in Closure Library, namespaces often function as part of the API


this leads to weird :require and :import cases


@aengelberg: internally type hints are used for optimization quite a bit, externally only ^boolean should be considered anything remotely official