This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-25
Channels
- # beginners (27)
- # boot (49)
- # cider (51)
- # cljs-dev (29)
- # cljsjs (1)
- # cljsrn (19)
- # clojure (59)
- # clojure-austin (2)
- # clojure-belgium (19)
- # clojure-china (1)
- # clojure-dev (14)
- # clojure-dusseldorf (7)
- # clojure-russia (8)
- # clojure-spec (115)
- # clojure-uk (45)
- # clojurescript (118)
- # css (6)
- # cursive (8)
- # datascript (20)
- # datomic (32)
- # emacs (5)
- # events (2)
- # flambo (21)
- # hoplon (58)
- # incanter (8)
- # jobs-rus (1)
- # jobs_rus (1)
- # off-topic (3)
- # om (22)
- # om-next (9)
- # onyx (5)
- # other-languages (79)
- # re-frame (126)
- # reagent (6)
- # ring (7)
- # specter (1)
- # untangled (119)
- # yada (38)
@pbaille: I read this the other day which might help: http://clojurescriptmadeeasy.com/blog/print-goog-datetime-as-inst.html
I’m aware it’s not a direct answer to your question but I thought it might help
yes i’m receiving a transit datastructure from the server containing #inst object, that became js/Date instance on the client
am i suppose to convert it to string and parse the string with cljs.time in order to create goog.Date instance?
Is there something like react-refetch for ClojureScript? https://github.com/heroku/react-refetch
@urbanslug: works, but probably best to use run!
same signature
@anmonteiro: Thanks 🙂
Returns a map? Not a seq?
@urbanslug: you probably want (map fn (fn-that-returns-a-map))
if (fn)
doesn’t return another function, that is
hard to know without seeing it
care to post a minimal case of what’s not working for you?
So the anonymous function is going to get a vector containing a key/value pair, is that what it’s expecting?
should work too
You might want something like (map (fn [[k v]] (do-something-with k v)) (fn-that-returns-a-map))
, so your keys and values get destructured into separate args
hmmm think I see the issue. map returns a sequence (lazy) but takes a collection is there a difference between this? There has to be. Also I’ll force a vector with (vec (map…))
@urbanslug: my preferred approach is to use into
with a transducer
e.g.: (into [] (map fn) coll)
whenever I want a vector out, that is
(let [keys (into [] (map #(str "ba" %) ["br" "bro"]))]
(println “br”)
(map #(println %) keys))
in your code above, you'll notice that it doesn't print anything but it will return a LazySeq
hello, i've come uppon this particular code in om next and having a hard time figuring what .. means
(om/set-query! ac
{:params {:query (.. e -target -value)}})
I can see it applies the event to those arguments but i cant see how the - and e works with it
and macroexpand dont seems to work
the ..
is a macro built into Clojure. Its basically method chaining in javascript i.e. e.target.value
yeah i could see. but why is it so funky
oh so its in clojure? I've searched the docs and couldnt find anything
yeah, but you don’t see it as often with Java interop in my experience because you are rarely grabbing instance properties (usually just grab methods or static members): http://clojure.org/reference/java_interop
I’ve created a repo explaining it here: https://github.com/ducky427/cljs-bug
essentially a map I am getting back from converting an edn string to a map using cljs.reader/read-string
isn’t behaving like a map at all
Any help would be really appreciated. A co-worker and I have spent better part of 2 days to figure it out and are completely lost now
@rohit: good job at shrinking down the example, probably you can drop it in #C07UQ678E as well
@richiardiandrea: thanks. will do.
Or open a jira ticket directly
I’ll do that as well. I thought if someone can identify the actual issue, then its worth creating a jira issue.
Yeah well it looks like part of the reader, but I will leave the scene to core devs ;)
just wanted to verify it here on my machine but https://gist.github.com/darwin/02923ab43978f24389d6faf464f14fe4
I’m not sure how to run it, java noob here, have been happily living with lein for 1+ yrs
I many times had strange behaviours with disparate node versions, especially regarding IO...in replumb I stick with 0.12.7 for now...
@darwin: figured out why it didn’t work the first time around - i hadn’t committed the .jar file. d'oh
yep, does not work here: https://gist.github.com/darwin/407b51ba569524c0a95bd651f1059fb5
@rohit might be helpful if you start reducing the values in the edn file you have, just to narrow it down. When I run it with empty values
{:pnodes []
:settings {:monitor false, :validation false},
:sdata {}
:data-files #{ },
:version "1.5"}
I get
java -cp cljs.jar:src clojure.main node.clj
node main.js
(:settings :sdata :data-files :pnodes :version)
1.5
:version key is present
@peterschwarz: thing is if i do that, it works as expected
Maybe not size, but perhaps something in the data? It's not really a huge string...
it almost feels like (in a very unscientific) the large datastructures somehow push cljs over a limit of some sort.
@peterschwarz: not really. have a look at https://github.com/ducky427/cljs-bug#how-to-mitigate-the-error
That's weird
@rohit another idea would be to check what the code compiles (transpiles sorry) to and try to execute it in node or even some JavaScript engine, maybe you've done that already
i’ve done that already. i could create a browser based test but then it would require a remote call to get the data
Just to check if it is cljs on node only
Remote call: https://github.com/Lambda-X/replumb/blob/master/src/browser/replumb/browser/io.cljs
i’ve got the code translated for the browser as well here: https://github.com/ducky427/cljs-bug-browser
great this is more likely to be a Cljs bug then
the bug feels like its in when the cljs.core/PersistentHashMap
datastructure is being created
after the read-string
?
what if you try tools.reader
there?
yes but it is probably copying it over
[org.clojure/tools.reader "1.0.0-beta1"]
[clojure.tools.reader :as reader]
well, I would then report all these results in #C07UQ678E and maybe open a JIRA ticket
@richiardiandrea: thanks for the help.
I wish I could have helped more 😉
no problem