This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-29
Channels
- # bangalore-clj (2)
- # beginners (22)
- # boot (28)
- # cljs-dev (91)
- # cljsrn (4)
- # clojure (30)
- # clojure-austin (8)
- # clojure-conj (4)
- # clojure-japan (1)
- # clojure-russia (3)
- # clojure-spec (9)
- # clojure-uk (8)
- # clojurescript (42)
- # cursive (2)
- # editors (1)
- # hoplon (16)
- # klipse (91)
- # lein-figwheel (1)
- # luminus (9)
- # off-topic (4)
- # om (83)
- # onyx (29)
- # perun (6)
- # re-frame (17)
- # spacemacs (6)
- # untangled (1)
- # vim (5)
I am making AJAX calls from the browser in cljs to a server in clj, but I keep getting [object Object] in my UI and I should probably try and understand what's happening instead of randomly adding str
and clj->js
calls on both sides of the connection until things work.
Note that my http knowledge is also limited so maybe I'm supposed to be getting :body data out or something?
@mathpunk that looks like the toString of javascript, try the difference between cljs.pprint/pprint, print and js/console.log.
uh... whoa, the result of my ajax request is of type `#object[Function "function (opt_xmlHttpFactory) { goog.net.XhrIo.base(this, 'constructor'); ....a bunch more stuff`
@wwajerowicz clj->js
has been subject to controversy lately
in you case, if you're building a single value, why not ust #js
instead?
then you can pick and choose how to convert values
@pesterhazy: I figured out what the problem was anyway, I was using js/Date
instead of js/Date.
haha, a javascript error 🙂
cljs.user=> (js/Date)
"Sat Oct 29 2016 13:01:57 GMT+0200 (CEST)"
cljs.user=> (js/Date.)
#inst "2016-10-29T11:02:00.014-00:00"
such a weird language
Yep, I was hoping to avoid these JS peculiarities in ClojureScript
there's no way around being friendly with the host, but with cljs you can avoid daily confrontations
although the occasional confrontation you will get will make you appreciate more that you're further away from plain JS than you used to be in '09 😉
hello guys, anyway to see how my cljs
code compile to javascript ?
e.g =>
(let [[a b] [1 2]]
(+ a b))
some function tells me how it translates into js
@baptiste-from-paris Wrap it in a fn and eval it in the repl
if you write cljs code in the top left and press ctrl enter, you see the generated js in the top right
heard of it and never realized it’s value
Is there anyone here well-versed in the ways of Re-frame? 🙂
Haha, thanks 🙂
I'm currently building a dashboard-like web-app, which has a sort of "personal public profile" for any person registered on it. The relative URI (using Secretary) for any such profile is then /person/:person-url-slug. I want to have anchors to sub-views of the profile (e.g. /person/person-url-slug/general
), and thus need to have access to the person-url-slug
in one of the child-components. Now to the actual question, is it a "bad" idea to have a map in app-db
, which is used to hold any data associated with the current page/view, in this case, the peron-url-slug
?
I'm thinking I could also have specific maps for each page, but that means I have to be doing a lot of manual cleanup when changing the page, right?
@wielderofmjolnir: Bring all your questions over to the #re-frame channel, it’s usually active and helpful. I think there are a few different options for what you need to do, and I’ve got time right now to chat a bit about them if you come over there.
Oh, will do! Should I copy-paste the question?
@wielderofmjolnir: Yeah, then everyone else will have a chance to help too