Fork me on GitHub
#re-frame
<
2023-10-01
>
Franklin17:10:58

Hello 👋 I've defined an event as follows in a re-frame app

(re-frame/reg-event-fx
 ::fetch-ona
 (fn [{:keys [db]}]
   (js/console.log "test")
   {:db (assoc-in  db [:dataview-charts :saved-charts-loading?] true),
    :http-xhrio
    {:method :get,
     :uri "",
     :format (ajax/json-request-format),
     :response-format (ajax/json-response-format {:keywords? true}),
     :on-success [::successful-fetch-saved-charts-response],
     :on-failure [::failed-fetch-saved-charts-response]}}))

Franklin17:10:11

For some reason when I dispatch this event, the HTTP request isn't made

Franklin17:10:31

I'm not sure what I'm missing..

Franklin17:10:33

nvm, I found that I didn't add a require for [day8.re-frame.http-fx] facepalm

mikerod16:10:18

Did you get any warnings about missing an effect handler for that? I’d think so, but I forget.

Franklin09:10:27

I might not have seen them if there were any