-
Notifications
You must be signed in to change notification settings - Fork 1
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
Move axios request config option into main uploadTable options argument #16
base: main
Are you sure you want to change the base?
Conversation
I'm actually opposed to this change, mainly because I think all (or at least most) of the methods in the API should have this option associated with it, and since they don't all contain an |
The thing is, these are in fact options for the function call. If we have to add an axios request config to each function's specialized options, that's not really an issue for me. And the fact that the function calls are not pretty to begin with is not a good argument for making them even uglier 🐱 We can also leverage typescript for this if needed: there can be a general I remain strongly in favor of this, because eventually people besides us will be using this library, and having two separate option arguments for each function, the latter of which is optional, will be very confusing. Both pain points are solved simply by allowing people to specify their axios options in the same place as all other options. |
@waxlamp and I discussed more offline, and decided that including the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding my previous comment, my ask would be to factor out the axiosRequestConfig
field into the general Options
interface, and changing FileUploadOptionsSpec
to extend that.
Done in d27d043. We're set up to add |
Agreed |
This cleans up the calling sequence for
uploadTable
, enabling the caller to place any axios config values into a special entry in theoptions
argument, rather than having to supply it as a separate argument. This makes the calling sequence easier to parse in the code, and makes it explicit what the formerly separate argument is for.The two calls to
uploadTable
in the multinet-client codebase will benefit from this change.