Move axios request config option into main uploadTable options argument#16
Move axios request config option into main uploadTable options argument#16
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 |
jjnesbitt
left a comment
There was a problem hiding this comment.
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 theoptionsargument, 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
uploadTablein the multinet-client codebase will benefit from this change.