For logging and other events, its good to track the to original caller of the http request. Since internally, on- is re-dispacted the event name in the fx [{:keys [db]} [event-name response]] is that of the event specified in on-. For specific events and success handlers, I can obviously pass in the event name of the caller. However this breaks down for generic handlers, and the default fallback events.
For example, our default on-failure warns that the error should be handled. It's hard to track down where the warning is thrown from because I can't pull the original calling event name.
(rf/reg-event-db
:http-no-on-failure
(fn [db]
(js/console.warn "Uncaught xhrio failure. Consider catching and setting loading state with :basic-xhrio-failure")))
Hey, I've thought about it for a bit, but I don't see a way to do this without breakage. Feel free to submit a PR, though. There might be a nice solution to be found.
For logging and other events, its good to track the to original caller of the http request. Since internally, on- is re-dispacted the event name in the fx
[{:keys [db]} [event-name response]]
is that of the event specified in on-. For specific events and success handlers, I can obviously pass in the event name of the caller. However this breaks down for generic handlers, and the default fallback events.Passing works if possible
For example, our default on-failure warns that the error should be handled. It's hard to track down where the warning is thrown from because I can't pull the original calling event name.