Open danielcompton opened 7 years ago
I would love to have that or at least be able to provide an interceptor that adds a default respone format. Usually in a web application you decide for one format once (being in a clojure environment it will most probably be transit) and then go with it for the rest of the applications life. It is cumbersome to have to provide it in every request one makes.
Currently, people need to provide a response format with every request, by requiring
ajax.core
and calling(ajax/json-response-format {:keywords? true})
or similar. cljs-ajax doesn't allow using keywords inajax-call
to lookup response formats because that will defeat dead code elimination. I can see two options:reg-fx
to be inside a function, and let people call it with a default response format as a parameter. This could also be extended to let people provide default interceptors and other default parameters in the request map.I'm probably leaning towards 2, but interested in other feedback.