This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-24
Channels
- # adventofcode (11)
- # asami (1)
- # babashka (9)
- # beginners (81)
- # calva (85)
- # circleci (4)
- # clojure (32)
- # clojure-europe (21)
- # clojure-nl (1)
- # clojure-uk (2)
- # clojurescript (28)
- # cursive (5)
- # fulcro (3)
- # honeysql (1)
- # introduce-yourself (1)
- # jobs-discuss (1)
- # missionary (1)
- # off-topic (1)
- # other-languages (42)
- # re-frame (12)
- # releases (1)
- # shadow-cljs (1)
Can anyone point me to the right place to ask about transit-js
with javascript, not clojurescript? I'm banging my head against the wall on some interop...
There are #javascript and #js-interop channels but they are very small. I'd just ask the question within this thread.
Ta. Well, the setup is that the client is javascript, no clojurescript. I'm trying to decode a transit json reply from the server. The raw response from the server is thus:
[["~:foo/bar",["^ ","~:message","I received your message '92c93001-df2d-4556-8565-ce629ef71c56'. It was 'Hello World'."]]]
:foo/bar,TransitMap {:message => "I received your message '92c93001-df2d-4556-8565-ce629ef71c56'. It was 'Hello World'."}
So, if anyone has any hints on what I need to do, then I would be grateful (the transit-js documentation seems to imply that I can call get
on the object (which should be a map)).
my transit reading is a little rusty but isn't this [[:foo/bar {:message "I received ..."}]]
?
Thank you, was able to delve deeper into it. I can sorta get there now, but tbh, it's a rpita.
I was able to extract out what I wanted by having a handler for the keyword, as transit-js won't convert ma map key that is a keyword, to a string, you have to do it yourself, i.e.,
const transitReader = transit.reader("json", {
"handlers": {
":": function(v) {
return `${v}`
}
}
});
Then I'm able to use transit.mapToObject(....)
to convert the payload into a regular JSON structure.
However, thank you @U05224H0W you helped me solve it 🙂
Will "https://clojure.org/news/2021/03/18/apis-serving-people-and-programs" be coming to CLJS and when?
No clue whether there's a roadmap, but this is the issue for that: https://clojure.atlassian.net/browse/CLJS-3299
ANN: just-maven-clojurescript-archetype 0.2-RELEASE - A Maven archetype for creating ClojureScript projects that only requires Maven.