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?
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 https://github.com/r0man/cljs-http and https://github.com/clojure/core.async libraries for making request. I have found https://github.com/myfreeweb/clj-http-fake 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.
Hi, I am trying to hack some functionality with keywords. My goal would be to have something similar to clojure's
clojure
(create-ns 'com.my-app.user)
(alias 'user 'com.my-app.user)
This lets me do ::user/name
without 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? Cheerssounds 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: https://contextualelectronics.com/cep005-clojure-script-on-hardware-with-mike-fikes
@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.
Any thoughts on this? :face_with_monocle: https://clojurians.slack.com/archives/C053PTJE6/p1599602572059300
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.
@tkjone I just wanted the data. I managed to do it finally. Thank you for the suggestions:) I used similar approach to your first suggestion.