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
Add a way to set default options #68
Comments
You could save your options to a var and pass that in? I'm not open to supporting this feature at this time. Sorry! |
The main problem comes with merging the default options with the custom options your using for the request. You have a |
I'll just fork the library and hack away on it with various features as you don't seem very open to suggestions. Grateful for all your work on the library though, it's super awesome 😄 |
I think this makes sense more in the context of #69. Otherwise, I don't see how this saves any work vs. setting your options to a variable if you want to reuse them, no? |
This seems to only make sense in the context of #69. Otherwise, I'm not sure how this is any more efficient than setting your options to a variable for reuse. |
atomic('https://test.com/users/save', { method: 'POST', headers: { 'Custom-Header': 'blah' }}); How would you merge the default headers with your custom ones as above? You would need to do a deep merge of some kind, or manually merge each property. That functionality is already inside Atomic I believe so it would be nice to leverage that, somehow. |
Just like you can with jQuery's
$.ajaxSetup()
or various ways to set axios defaultsThis would be very useful for when you want to always send e.g. CSRF token or certain headers, etc.
The text was updated successfully, but these errors were encountered: