This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-02
Channels
- # beginners (29)
- # cider (41)
- # clara (1)
- # cljs-dev (17)
- # cljsrn (1)
- # clojure (158)
- # clojure-dev (2)
- # clojure-dusseldorf (2)
- # clojure-italy (8)
- # clojure-mexico (1)
- # clojure-russia (2)
- # clojure-spec (43)
- # clojure-uk (1)
- # clojurescript (44)
- # community-development (98)
- # cursive (9)
- # data-science (8)
- # datascript (4)
- # datomic (30)
- # emacs (6)
- # fulcro (11)
- # graphql (6)
- # jobs (1)
- # jobs-discuss (27)
- # lein-figwheel (5)
- # luminus (13)
- # lumo (4)
- # off-topic (28)
- # onyx (9)
- # parinfer (12)
- # perun (2)
- # portkey (5)
- # re-frame (48)
- # ring (2)
- # shadow-cljs (52)
- # spacemacs (29)
- # tools-deps (15)
- # unrepl (9)
- # vim (7)
- # yada (3)
thank you @mikethompson!
@mikethompson so, the key concept i needed to see was ‘dispatch-n’ https://github.com/gothinkster/clojurescript-reframe-realworld-example-app/blob/238917d03956dec5c5b7985a481086f83d983d9b/src/conduit/events.cljs#L75-L113
you should totally link to these lines from your new FAQ entry 🙂
@mikethompson much better, thank you: https://github.com/robert-stuttaford/bridge/blob/67c1fcb706734b790c032a15dc3f7f4444b5b47d/src/bridge/ui.cljs#L28-L32 https://github.com/robert-stuttaford/bridge/blob/67c1fcb706734b790c032a15dc3f7f4444b5b47d/src/bridge/event/ui/edit.cljs#L33-L34
@robert-stuttaford yep, have a look over https://github.com/Day8/re-frame/blob/master/docs/API.md
There's also dispatch-later
effects, etc
Hi, who have already tried kee-frame https://github.com/ingesolvoll/kee-frame . Any reviews?
I’m experimenting with it, very clean, etc. Trying to figure out an issue when their not being a route when the page loads
Hi everyone! Does anyone have an example or can give a hint on how to subscribe to a route change?
Is the example here helpful? https://github.com/quangv/re-frame-html5-routing
Thanks! I'm sorry I didn't explain properly what I need. Here's a better explanation of the issue I'm having https://github.com/metosin/re-fill/issues/4
The error response I get with http-fx doesn’t seem to give a status code in the way I’d expect:
{:uri "",
:last-method "POST",
:last-error " [0]",
:last-error-code 6,
:debug-message "Http response at 400 or 500 level",
:status 0,
:status-text "Request failed.",
:failure :failed}
Is there a way to get a :status 500 or somesuch?@alex-dixon I think the :status
comes directly from the response map returned from the xhr response
https://github.com/Day8/re-frame-http-fx/blob/master/src/day8/re_frame/http_fx.cljs#L35
So to me, that looks like your response map itself (from whatever server you are getting it from) is returning a :status 0
Ok. Server was down…was expecting a 404?
The error handler is firing when I receive this, which seems triggered by an empty response body from the server. If I put {ok: true} it registers as success:
[:response nil]
[:last-method "POST"]
[:original-text ""]
[:last-error ""]
[:failure :parse]
[:status-text
"Unexpected end of JS … been JSON keywordize"
Unexpected end of JSON input Format should have been JSON keywordize
]
[:status 200]
[:uri ""]
[:debug-message "No Error"]
[:last-error-code 0]
I’m using (json-response-format {:keywords? true})
for :response-format
@alex-dixon I’m wondering at this point if your issue is not in re-frame
’s :http-xhrio
fx, but instead in the ajax lib response formatting
Yeah. I have a Node/Express server doing res.status(200).send()
which seems to result in a parse error
If I provide some dummy body on the server like res.status(200).send({ok: true})
there’s no parse error and it registers as successful with re-frame
The request itself is processed via ajax.core/ajax-request
. re-frame
:http-xhrio
doesn’t determine if it is an error or success it looks like
I don’t know enough at that level to have much good advice as to why your response is coming back like htat
Thanks. It’s workable but seems like it could be a bug. At least would like it to be smoother for beginners. I started writing a comparison of re-frame and Redux for JS devs over the weekend and :http-xhrio is a great feature that I mention quite a bit
could be that http was 200 but the library threw its own error trying to understand the response: “Unexpected end of JS … been JSON keywordize”
Is it possible to write handlers that do something like this?:
(reg-event-fx
[::success ::routes/dashboard]
(fn [{:keys [db]} x]
(println "GQL success" x)))
I can do something like this but not sure if it’s better:
(reg-event-fx
::success
(fn [{:keys [db]} [_ route-key result]]
(let [handler (route-key query->success-handler)]
(when handler (handler result)))
(println "GQL success" x)))
Pretty sure it’s not 😅
@alex-dixon I end up doing things like :dashboard/success
it seems to me that you aren’t buying anything by putting a lookup map in the query->success-handler
might as well just lay out each “handler” as an event for its purpose. I don’t see dynamism in what you have above that would have any advantage to having a parameterized route-key
in the event vector input
I haven’t seen many examples of using non-keyword keys for registered events/subs in re-frame
. I don’t know if anyone has pointed out to pro’s/con’s to doing that though.
Thanks. Hadn’t considered. There’s tradeoffs to each I suppose. Guess I was wondering if there’s something like rf/path or some middleware I could/should be using more. Most of the examples I’m seeing are as you describe
@matthewdaniel we're making solid use re-com
so it certainly isn't dead to us
UIs libraries are difficult to generalise (in styling terms)
@robert-stuttaford @soulflyer can you give ways to reproduce the errors you're seeing? I took a look at Bridge, but couldn't figure out how to get the errors you were seeing, Figwheel just 404'd on the JS
I also took a look at hinh-anh and also couldn't get the errors to show up
@mikethompson it looks like pull requests are being ignored, i am more wondering dead as in not being maintained rather than unused
Hi, I'm looking for examples of routing where more "general" routes are hit before more specific routes. For example, if there were two routes for /admin/users
and /admin/posts
, the routing lib would detect that I'm attempting to enter the /admin
route regardless of the sub-route, and check that my authenticated account has access. This may already be supported (currently trying to get familiar with bidi), but I haven't seen an example of it yet. Any help/pointers/links would be grealy appreciated.