This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-20
Channels
- # aws-lambda (8)
- # beginners (37)
- # cider (43)
- # cljs-dev (12)
- # clojure (121)
- # clojure-italy (19)
- # clojure-nl (1)
- # clojure-poland (1)
- # clojure-russia (14)
- # clojure-spec (6)
- # clojure-uk (98)
- # clojurescript (28)
- # core-async (1)
- # cursive (7)
- # datomic (4)
- # emacs (63)
- # events (8)
- # fulcro (19)
- # graphql (4)
- # hoplon (3)
- # mount (1)
- # nrepl (101)
- # off-topic (15)
- # om (3)
- # pedestal (2)
- # portkey (31)
- # protorepl (2)
- # re-frame (26)
- # reagent (26)
- # reitit (2)
- # shadow-cljs (58)
- # spacemacs (8)
- # specter (5)
- # sql (56)
- # test-check (11)
- # tools-deps (48)
- # vim (52)
Hi, is it possible get header of response in http-xhrio effect success handler? I need to refresh token from request header but I don't know how π
have you reviewed the code, @kucerm2? if you donβt like what the code does, you could copy it into your project and modify it
I think this was answered here recently, you can configure it to return the raw goog.net.XhrIo, using this as your response-format: {:read identity :description "raw"}
so I'm new to re-frame and trying to understand exactly how I would create a specific behavior:
1. A component is rendered that is subscribed to a certain field in the app-db
2. When the field in the app-db is gotten, it is detected whether it is nil
or not
a. if nil
, the field's is changed to :loading
and a network request is started that will eventually replace the value
b. if not nil
, then do nothing
I'm trying to figure out how this fits into events, effects, coeffects, subscriptions... anyone know the best way to go about this?
Sounds like you're not too familiar with unidirectional data flow? your network request needs to be started by an event. The event could check if there's already data. Your remaining problem is how/when to trigger that event, I guess?
I'm familiar with unidirectional data flow. But I also am interested in isolating the concerns of my components data dependencies
Ok. So the principles are pretty simple: Your views subscribe to data, and dispatch events. Your subscriptions are pure and return content from the database.
Your remaining problem is how to trigger the network request, am I right? I made a framework for this, you could check it out to use it or get inspired to roll your own solution. http://ingesolvoll.github.io/posts/2018-04-01-kee-frame-putting-the-url-in-charge/
Hrmm... I amended my handler to use fn-traced
but I still get "Code trace is not currently available for this event" in the dashboard.
I don't understand what happens the first time, but it shows me something in the Events tab
(continuing above) ultimately what I'm trying to do is do an initial server-rendering of my re-frame app using SSR π so I want to be able to detect when all of the page's data dependencies are done loading
right now I'm doing this by dispatch-sync
-ing inside of a subscription π¬ is that taboo?
Or am I wrong? Read this one, still not very excited about it though https://github.com/Day8/re-frame/blob/master/docs/Subscribing-To-External-Data.md
I decided to eschew re-frame for now and use that model (of returning a ratom & triggering the request) with pure reagent + some other libs
Okay so it turns out, when I looked at the developer console that I was firing :events/foo
rather than ::events/foo
and I think this was causing the Event trace to break. Might be nice if 10x could trap these failed event dispatches and throw them up somewhere or, if it already does, somewhere more in your face.
@danielcompton I just got the function tracing in re-frame-10x set up - simply awesome!