You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At least from my point of view, the second parameter does not bring in any additional value, as it is not really configurable, but simply relies on the first parameter.
Describe the solution you'd like
Bringing in the AxiosResponse to the return type, would end in a cleaner interface, only defined by input and returned type (in fact type of Promise of AxiosResponse):
Why is this closed? Will this be considered in future releases, or will this just not be implemented? Currently, to type the body, we need to add the second type param each time, which should not be needed.
Is your feature request related to a problem? Please describe.
Currently, the types describing the methods are using three parameters (see https://github.com/axios/axios/blob/master/index.d.ts#L177)
At least from my point of view, the second parameter does not bring in any additional value, as it is not really configurable, but simply relies on the first parameter.
Describe the solution you'd like
Bringing in the
AxiosResponse
to the return type, would end in a cleaner interface, only defined by input and returned type (in fact type of Promise of AxiosResponse):Describe alternatives you've considered
For sure, the type can be kept this way, but brings in some mental overhead and no benefit in defining the second generic parameter.
Additional context
I know this might be a breaking change, but I guess it brings in more clarity on the interface, simply dependent from input and output types.
The text was updated successfully, but these errors were encountered: