Fork me on GitHub

I just gave re-frame.http-fx a try. Seems nice, but I had my custom service return a 422 response code on incorrect inputs, and the “result” passed to my failure handler does not include the response code so I cannot differentiate it from the service not being available or whatever. Am I missing something? I need some way to get at the raw response, I guess.


@eoliphant Components should definitely not fire events by themselves. Is it possible to use something from with the HOC?


@hiskennyness Hmm, judging by the sources, the error code should be in :last-error-code. Do you not have that key at all?


@hiskennyness Ok, :last-error-code is something else, however http-fx "0.1.6" gives me this in my error handler:


[:response "422 Unprocessable Entity"]
[:last-method "GET"]
[:last-error "Unprocessable Entity [422]"]
[:failure :error]
[:status-text "Unprocessable Entity"]
[:status 422]
[:uri ""]
[:debug-message "Http response at 400 or 500 level"]
[:last-error-code 6]


I am at 0.1.6. What does your :http-xhrio look like? I have

{:method          :get
                        :uri             uri
                        :response-format (ajax/json-response-format {:keywords? true})
                        :on-success      [:scramble-check]
                        :on-failure      [:scramble-http-failure]}


Oh, I used ajax/raw-response-format.


The handler for :scramble-http-failure gets just “result” which is fairly anemic.


Most likely, json-response-format just strips away most of the data.


Thx. That explains that. I did not see other formats documented.


hi everyone. I created this little javascript prototype library that mimics re-frame


I’m planning to use it on an upcoming React project. will see how it goes 🙂

Drew Verlee12:07:46

I’m doing some intiial research, is there anything like RxFiddle for reframe? It’s possible this question makes no sense, let me know if you have looked into the cross section between re-frame and rx-fiddle: > Introducing RxFiddle: RxFiddle is designed to help with these objectives by providing a visual overview of Observable flows, and also detailed views inside the data flows at an event level. RxFiddle therefore contains a data flow graph visualiser, and a dynamic Marble diagram generator. It looks like this:


Hi, is anyone able to get the "path-inspector" to work in re-frame-10x? Doesn't seem to work for me (v 0.3.3).


I’m running into issues when running spec validation as an interceptor. Usually when the app starts not all keys in the db are populated, as we have to fetch some data from different backend services. We can always validate and set the keys that are not populated as optional, but once we have fetched the data we don’t want these keys to be optional anymore. For example, if some handler removed a key that was populated by mistake we want the spec validation to catch that. It almost looks like we want different specs for different app states. Does anyone have ideas on how to handle such cases?


@zalky Path inspector works only after you fire some event, and it shows you paths in app-db after the changes after the event.


@p-himik: I'm seeing some pretty odd behaviour atm. I'm getting a console error:

Uncaught TypeError: Cannot read property 'document' of null
    at day8$re_frame_10x$events$open_debugger_window (events.cljs:287)
    at events.cljs:298
    at mranderson048$re_frame$v0v10v2$re_frame$std_interceptors$fx_handler__GT_interceptor_$_fx_handler_before (std_interceptors.cljc:133)
And now the db inspector does not want to load anything. The app seems to work fine, and I'm working on a commit that I know previously worked with the db-inspector. It seems that somehow re-frame-10x is just nerfed... I've tried multiple previous commits, rebooting the build, clearing out target files... I'm stumped.


@zalky You'll have to follow up with the devs on this one - I have no clue. The only thing that comes to mind is that there're two versions of re-frame-10x, 0.3.3 and 0.3.3-react16. Maybe you're using an incorrect one.


I’ve seen the “cannot read property ‘document’ of null” message sometimes too, but it seems to be relatively harmless most of the time. I did see one weird thing: I added localhost to my list of sites that are allowed to use popups in my Chrome settings, and suddenly my 10x debug window popped open even though I’d previously had it closed. The “document of null” message went away after that, at least for a time.


Haven’t been able to reproduce that since, tho, so :thinking_face:


@p-himik: appreciate the response! While it did not fix the issue, I had updated react recently and the dep was out of sync.


@manutter51 brilliant, the popup behaviour of re-frame-10x did seem to be the culprit. I had not too long ago tested out the "pop out" floating window, during which time the browser refreshed, which nerfed the 10x session. Then it has been trying to pop out ever sense, and I never noticed that the popup blocker was preventing it from doing so.


Interesting, glad that helped

👏 4

@zalky That's probably worth "documenting" as a GH issue. 🙂

👍 4

so for a long time i’ve been using

as an extremely opaque method to be cheeky for subscriptions in the db. since the kw :something just takes the db value and returns (get db :something) it works fine.


but just recently I noticed this doesn’t seem to work anymore… and I don’t know when that changed, and I don’t see any reason why it would change. does this work for others?


it seems that if the db value at :something is not defined (as in a plain ol empty map {}), the subscription returned is actually [:something] instead of nil