This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-23
Channels
- # admin-announcements (95)
- # beginners (16)
- # boot (50)
- # cider (15)
- # cljs-dev (47)
- # clojure (149)
- # clojure-italy (5)
- # clojure-russia (94)
- # clojurescript (163)
- # clr (1)
- # cursive (6)
- # datavis (9)
- # editors-rus (4)
- # hoplon (24)
- # jobs (9)
- # ldnclj (32)
- # lein-figwheel (4)
- # mount (5)
- # off-topic (2)
- # om (68)
- # parinfer (31)
- # proton (1)
- # reagent (32)
- # remote-jobs (1)
- # yada (5)
@gadfly361: can you tell me more about your book?
[:button.btn.btn-sm.btn-default {:class (if (pos? @selected-count) "btn-primary" "btn-default disabled") :on-click #(dispatch [:foo])} "bar"]
@si14: i do it like this
(->> [(when x "foo")
(when y "bar")
(when z "baz")]
(filter identity)
(str/join " "))
which you can wrap into a function such as
(defn classes
[& cs]
(->> cs
(filter identity)
(clojure.string/join " ")))
Yes, that's the way. I'd probably use (remove nil?)
instead of (filter identity)
But that's just personal choice
ha, yeah, that's probably more idiomatic. i think i have stockholm syndrome
Very nit picky on my part
it's just strange to concatenate strings given that classes are (arguably) better represented by keywords
@mikethompson: yeah, that's awesome! Are you going to merge it?
@si14: the equivalent when dealing with styles is to use merge
[:div
{:style
(merge
(when cond1 {:background-color "blue"})
(when cond2 {:font-size "24px"})})
"Hello"]
@si14 I'd love to merge 154, but that's up to Dan
@mikethompson: ah, I see. I was confused by your "owner" status in the repo
I have some rights, but I defer to Dan who is the original author, and true owner
I have the right to triage issues, mostly.
tbh, your comment here https://github.com/reagent-project/reagent/issues/212#issuecomment-166458254 seems gloomy. Do you think that Reagent has problems?
Dan tends to be very reclusive. And to do his own thing. Not a lot of consultation
So that's me whinging
somewhat tangential: re-frame was eye-opening for me. thank you on the other hand, I've started to see why David did some stuff in Om.Next the way he did. E.g. "automagical" joins and deduplication
in general, I like how stuff converges to some common way of doing things, e.g. global state atom with subscriptions.
I haven't looked into OM.Next much yet. OM (original) was massively, aggressively hyped, and, while it had a couple of interesting ideas, I thought it had some terrible ideas too. So now there is OM.Next and it is also being massively hyped, I'm cautious to spend many brain cycles on it. I think David's position creates a slight reality distortion effect. I'll wait for it to come out of alpha. Who knows, i could be pleasantly surprised.
What is interesting to me is MotorCycle.js ... it uses my favorite v-dom library: snabbdom, and it has a very FRP nature. I find that direction really interesting.
https://github.com/motorcyclejs/core (but to properly understand it, you'll have to look at http://cycle.js.org/)