This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-23
Channels
- # adventofcode (92)
- # beginners (12)
- # boot (3)
- # boot-dev (38)
- # cider (9)
- # clara (26)
- # cljs-dev (26)
- # cljsrn (3)
- # clojars (3)
- # clojure (48)
- # clojure-france (6)
- # clojure-greece (2)
- # clojure-spec (3)
- # clojurescript (7)
- # datomic (3)
- # fulcro (6)
- # hoplon (19)
- # jobs-discuss (1)
- # leiningen (4)
- # lumo (9)
- # off-topic (8)
- # onyx (43)
- # planck (10)
- # powderkeg (4)
- # precept (44)
- # re-frame (4)
- # shadow-cljs (4)
- # sql (13)
- # uncomplicate (1)
- # unrepl (3)
I tried to emulate re-frame's [talking to other services](https://github.com/Day8/re-frame/blob/master/docs/Talking-To-Servers.md) code, with the following example:
(rf/reg-event-fx
:request-address-data
(fn [_ [_ addr]]
{:http-xhrio {:method :get
;;
:uri (str " " (name addr) "/balance")
:response-format (ajax/json-request-format)
:on-failure [:failed-get-request]
:on-success [:address-data-loaded]}}))
Now, when the data arrives, the on-failure callback, :failed-get-request
gets invoked instead of the on-success
which got me very confused as the two are like night and day.
Any quick pointers, I might want to dig further in.@mohamedhayibor did the response look good? On the on-failure event check your response. Maybe something went wrong
@mohamedhayibor check your :response-format
. It should be ajax/json-response-format
and maybe you need to specify a format (request format)