Fork me on GitHub
Jeremie Pelletier03:09:06

Hello! I'm trying to use error boundaries in reagent and I can't seem to get the setState example to work; the error is caught and displayed, but the reset button with the call to .setState never updates the component is there something special to do for this to work?

Jeremie Pelletier03:09:26

the first example with the ratom does work however


Hello everyone, I want to mock responses from a server in a ClojureScript application and I am trying to figure out how to do it. I am using and libraries for making request. I have found but it is for Clojure. Is there a way to mock responses in ClojureScript?


Are you looking to an E2E flow or do you just need the data? Depending on the goal, I usually do one of a few things: • stub the HTTP client to return response • setup a quick little server which returns the responses. • use spec to generate some random data as I need.


@U6GNVEWQG I just wanted the data. I managed to do it finally. Thank you for the suggestions:) I used similar approach to your first suggestion.

👍 3

Hi, I am trying to hack some functionality with keywords. My goal would be to have something similar to clojure's

(create-ns '
(alias 'user '
This lets me do ::user/namewithout creating the alias in the ns form and creating an empty com/my-app/user.cljs. Is there something I am missing that allows that? If not, is it a good idea to write a macro that would modify the clojurescript compiler's env state to add this namespace and alias? Is it even possible? Cheers


There's a Jira ticket for that. If you really want to work on such a functionality, it may be worth it to work on that ticket so that the functionality ends up in the core.


sounds like a road of pain. why not just :user/name. why tie this to an actual namespace?


An interview with Chris Gammell, a portion of which goes into ClojureScript on the ESP32 hardware:

👏 6

@dpsutton it's the idea that :`my-app.user/name` is different than :your-lib.user/name . If we just use user/name there for instance would be a clash when both my app and your lib want to spec :user/name . Now I could use the long form everywhere but it would make for very long keywords in some cases.


I am not an authority on this matter, but having seen it discussed before, I think that several experienced Clojurians simply do use the fully qualified keyword everywhere, without aliases. Copy-and-paste helps avoid typing, but of course that doesn't make the keywords shorter when reading.