This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-22
Channels
- # admin-announcements (4)
- # bangalore-clj (1)
- # beginners (28)
- # boot (16)
- # clara (4)
- # cljs-dev (28)
- # cljsrn (63)
- # clojure (136)
- # clojure-berlin (7)
- # clojure-gamedev (1)
- # clojure-nl (4)
- # clojure-russia (47)
- # clojure-sg (8)
- # clojure-spec (39)
- # clojure-uk (132)
- # clojurescript (66)
- # clojurex (5)
- # clojutre (2)
- # code-reviews (14)
- # core-logic (1)
- # cursive (13)
- # datavis (1)
- # datomic (35)
- # dirac (1)
- # editors (1)
- # hoplon (46)
- # jobs (1)
- # lambdaisland (5)
- # lein-figwheel (1)
- # mount (10)
- # off-topic (3)
- # om (67)
- # onyx (54)
- # planck (7)
- # proton (15)
- # protorepl (1)
- # re-frame (174)
- # ring (4)
- # ring-swagger (3)
- # specter (14)
- # untangled (15)
is there a cleaner way to accomplish the below so that I end up with the same result? i.e.
{:parent-key {:other-child {}, :child-key {:child-data {}}}}
(update-in {:parent-key {:other-child {}}} [:parent-key :child-key] (constantly (:child-key {:child-key {:child-data {}}})))
@shooodooken elaborate a bit on what you’re trying to do
associate the 'child-key structure in under the parent-key structure without affecting 'other-child'
(assoc-in {:parent-key {:other-child {}}} [:parent-key :child-key] {:child-data {}})
is the cleanest i can get?
in real life, child-key & child-date are a single variable passed in so I was hoping to nest the structure without having to explicitly state the child-key in the assoc-in or update-in
what should the result look like?
and you post result data structure?
result should look like this
{:parent-key {:other-child {}, :child-key {:child-data {}}}}
I’m trying to figure out how to do a simple http get request from frontend clojurescript. I need to hit an external rest api endpoint and get the json back. That’s all.
Yep that looks clean with the assoc-in @shooodooken
That should do it
@josh_tackett I tried using it but I can’t figure out what to put in my project.clj deps. This is the first time I’m trying to use clojurescript at all.
this is more of a java interop question, but is there anything special you need to do to import an interface in an ns declaration?
Note that nested class is referred via '$'
(reify java.lang.Thread$UncaughtExceptionHandler …
Is it an interface from Java land?
In the ns, I think you just import the interface/parent class.