Fork me on GitHub

@quoll I can't remember how that ended up in Clojure, @alexmiller would know - if it's intentional then that fix just hasn't been ported over


I wasn’t sure if I could look in a transient map, but it appears that I can. I’ve been doing some testing on it, and it’s reliable for large numbers of keys (both Clojure and ClojureScript). (Yes, I know I need to look at the sources and not rely on empirical testing) But the transient approach is certainly faster for loading a lot into the map, so that’s why I’m trying to stick with it.


that was CLJ-700 which was fixed in 1.9, iirc

👍 1

OK, thank you


i'm trying to translate material-ui js samples to cljs as a first time front end writer say:

        startIcon={<DeleteIcon />}
and my best guess cljs equivalent is:
(defn add-thing-button [{:keys [^js classes]}]
  (fn []
    [:> Button {:classes (.-button classes)
                :variant    "contained"
                :color      "primary"
                :on-click   #(rf/dispatch [:add-thing/open-dialog])
                :startIcon icons/Add    ;; <- refuses to render

     "Add Thing"]))

(defn add-thing-button-widget [kv]
  [:> (with-styles
         (add-thing-buton kv)))])
The :startIcon refuses to render no matter how i package it. What noob error am I making? Any help appreciated


r/as-element or better :startIcon [:> icons/Add] you see here that <DeleteIcon /> is an instance of element but not symbol of class/function-component.


thanks for the reply. when i try :startIcon [:> icons/Add]i get a blank page but no errors in the console.


sorry, Im bit rusty, it's a prop so it wont be passed trough to reagent directly, you'll need to call some reagent function on this. I recommend reading the interop parts of the reagent documentation


no worries, thanks for taking the time to reply

cljs 1

r/as-element sounds right to me


after reading the linked doc and sample, create-element turned out to be the answer. Thanks all

Shako Farhad14:08:36

Does anyone have any experience with the new Web Animations API? How do you use it with reagent, or re-frame, or at all? ^^


uhm weird I'm trying to use the cljs-ajax library in a cljs file, and the same exact code works fine in CLJ but doesn't do anything in CLJS, simply returning this but never actually calling the handler function

#object[Object [object Object]]


ah right it's just

has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I should have checked the console before


I’m late to the party, but I wanted to say… I haven’t looked at Quick-Start for a while, and just went through it now. I’ve been working with ClojureScript command line repls for a while, but I am blown away at how smooth and easy it is now. I’m not sure who else was involved, but I can see it was documented by @dnolen. Thank you!

👍 2

@quoll there's a good amount of feedback about it so the credit goes to everyone that tried it out

👍 1

that said, it was driven driven by finally losing patience with all the scripting to do the most basic things

👍 2

the CLI stuff was all designed to address that and simply adopt Clojure conventions


which is why I love it 🙂


I love it too.


Am reading the clojurescript FAQ for JS devs and saw "You can also write functions in ClojureScript and call them from JavaScript." Was just wondering, is there a good way to incrementally convert a JS codebase to Clojurescript? Or must it be a complete overhaul? :o


@zackteo you can create a "helper" namespace in cljs, and pull it into your js module


migrate functions one by one into the helper, until the helper replaces the thing that uses it


you should be able to move one fn at a time, and you might not even need to rewrite any tests :D