This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-02
Channels
- # bangalore-clj (1)
- # beginners (5)
- # cider (24)
- # clara (2)
- # cljs-dev (6)
- # cljsrn (2)
- # clojure (10)
- # clojure-austin (2)
- # clojure-serbia (1)
- # clojure-spec (6)
- # clojure-uk (6)
- # clojurescript (59)
- # cursive (1)
- # datomic (10)
- # emacs (3)
- # events (7)
- # graphql (1)
- # jobs (2)
- # lein-figwheel (9)
- # off-topic (40)
- # pedestal (5)
- # portkey (2)
- # re-frame (5)
- # reagent (20)
- # shadow-cljs (7)
- # spacemacs (4)
- # specter (19)
- # testing (21)
Can someone explain the .- syntax to me? Example
defn atom-input [value] [:input {:type "text" :value @value :on-change #(reset! value (-> % .-target .-value))}])
I assume that's calling js functions?
Right right.
the trick is that you need a special form in clojurescript because accessing a property in javascript isn’t a function call
yes, interop with js is...weird 🙂 At least me going in blind and finding my way through it. My first encounter with it was with this
(juxt #(.getHours %) #(.getMinutes %) #(.getSeconds %))
But I guess it's the same with java interop, which I haven't used a ton of
I assumed it was interop, but i wasn’t sure and it can be hard to google for syntax. Thanks everyone
I’m about 2-3 years late asking this question, but what is it about react that makes it a bit hit in the clojure community? People like to say its “functional” but given how broad that definition tends to be it doesn’t really narrow it down for me. I recall being familure with these concepts when react first hit, but i haven’t done much in the last year.
so its all faded…
as I understand it, the thing that makes it a nice fit is that react’s virtual-dom + reconciliation algorithm makes for a nice fit with functional programming: the UI can be thought of as a pure function of state without worrying about how to mutate the dom to make it so
(I hate the fact that so much interesting stuff is in video form. I don’t know of any other community that is as video focused as clojure.)
Yea. I would rather have a research paper on the topic at this point. The whole thing seems hard to understand. I need to sit down with someone that has really thought deeply about these things and has the historical context to frame where we are now and how we got there. Those people tend to have better things to do. lol!
maybe this talk: https://www.youtube.com/watch?v=nDNU2pmuJA8
Though i suspect there are lots of papers written on these topics, but they were probable written once, 15-50 years ago and now its just a matter of shouting it at people tell we all get the message.
Are the react diff changes scoped by components? or are those unrelated
I’m not sure I follow. React builds the virtual dom each time and compares it with the actual dom and then issues mutations
Potentially apropos https://medium.com/@sweetpalma/gooact-react-in-160-lines-of-javascript-44e0742ad60f
nice. I’ll take a look