Fork me on GitHub
#re-frame
<
2021-04-14
>
restenb08:04:36

quick question. re-frame's HTTP client expects :on-success and :on-failure to be defined as events. is there a way to no-op these in the case I want to do nothing with the response?

restenb08:04:01

that is, a way that doesn't involve just making a :no-op event handler, which of course is trivial enough

p-himik08:04:11

Just don't specify the keys.

restenb08:04:08

perhaps, but you get a console error then that annoys me re-frame: no :event handler registered for: :http-no-on-success

p-himik08:04:37

Ah, huh, yeah. Well, either your own :no-op with explicit keys or your own :http-no-on-success and :http-no-on-failure without the keys.

p-himik08:04:41

(doseq [id [:http-no-on-success :http-no-on-failure]]
  (rf/reg-event-ctx id (fn [ctx _] ctx)))