Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide default response-format? #4

Open
danielcompton opened this issue Oct 10, 2016 · 1 comment
Open

Provide default response-format? #4

danielcompton opened this issue Oct 10, 2016 · 1 comment
Milestone

Comments

@danielcompton
Copy link
Contributor

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 in ajax-call to lookup response formats because that will defeat dead code elimination. I can see two options:

  1. Create an atom where people can set a default response format
  2. Change the 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.

@sveri
Copy link

sveri commented Apr 22, 2018

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.

@superstructor superstructor self-assigned this May 14, 2019
superstructor added a commit to superstructor/re-frame-http-fx that referenced this issue May 15, 2019
In preperation for breaking API changes in the next release that are
required for day8#4, day8#7 and day8#32 new fx keywords will be introduced.
superstructor added a commit to superstructor/re-frame-http-fx that referenced this issue May 15, 2019
In preperation for breaking API changes in the next release that are
required for day8#4, day8#7 and day8#32 new fx keywords will be introduced.
superstructor added a commit to superstructor/re-frame-http-fx that referenced this issue May 15, 2019
In preperation for breaking API changes in the next release that are
required for day8#4, day8#7 and day8#32 new fx keywords will be introduced.
@superstructor superstructor added this to the 0.2.0 milestone May 15, 2019
@superstructor superstructor modified the milestones: 0.2.0, 0.3.0 Nov 6, 2020
@superstructor superstructor removed their assignment Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants