This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-17
Channels
- # beginners (47)
- # boot (1)
- # calva (18)
- # cider (16)
- # cljs-dev (6)
- # cljsrn (14)
- # clojure (46)
- # clojure-dev (6)
- # clojure-italy (3)
- # clojure-sweden (2)
- # clojure-uk (1)
- # clojurescript (21)
- # css (1)
- # data-science (1)
- # emacs (2)
- # figwheel-main (2)
- # graalvm (11)
- # leiningen (3)
- # nrepl (19)
- # off-topic (1)
- # pathom (4)
- # re-frame (17)
- # reagent (4)
- # shadow-cljs (49)
Devcards are compatible with re-frame https://juxt.pro/blog/posts/cljs-apps.html
@lu so the following issues are no longer an issue: https://github.com/bhauman/devcards/issues/105, https://stackoverflow.com/questions/46330334/how-do-i-make-devcards-work-with-re-frame ??
are there any adjustments that need to be made or do you just use both re-frame and devcards as normal?
I found myself using the approach mentioned in issue #105, but only when I needed to walk the state history ... another trick I used was to wrap views with functions that would simply provide all the data to be consumed by the component.. in this way you can either hard code the data for the devcard purpose or get it via a subscription in your actual app..
do you know what the guy was trying to achieve with the iframe devcard branch or why that was necessary?
Yeah basically if you have one global state for all your cards, the history will change for all of them anytime one devcard updates because they share the same ratom.. I personally don’t find extremely useful the ability to walk the state history .. I rather have the state steps hardcoded in different cards so that I can look at them all at once without the need to interact with the UI
Ah, gotcha. Yea, that does sound like a nice way to work. At the same time, for complex interactions, it could explode the number of cards required.
I spoke to someone who said that they have pure and subscribing variations of their components. Similar to Abramov's containers and presenters pattern (I think that's what it is called)
I'm trying to use cljs-ajax
to perform a request from my re-frame event to my localhost web server. However, it seems like the uri
parameter cannot specify a port. only the endpoint.
(POST
""
{:format :json
:params {:value (:value db)}
:handler #(re-frame/dispatch [::update-database %])
:error-handler #(re-frame/dispatch [::error-handler %])})
this example returns status 0. Seems like my endpoint cannot be reach. If I change the uri
to /save
it calls some html page. I think I have to make a previous setup to let the library knows the whole url address of my backend service. But I could not find where I specify that{:uri
the whole error message
(ajax/ajax-request
{:uri ""
:method :get
:handler #(handler %)
:response-format (ajax/transit-response-format)})
(ajax/POST "" )
#object[Object [object Object]]
;;; from python -m SimpleHTTPServer 8000
Serving HTTP on 0.0.0.0 port 8000 ...
127.0.0.1 - - [17/Aug/2019 18:37:31] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [17/Aug/2019 18:37:31] "OPTIONS / HTTP/1.1" 501 -
(POST ""
{:params {:email "this-is-email@d"}
:handler #(rf/dispatch [:foo %])
:format :transit})
Again.. working on my machine..