Fixed type definition of use method on AxiosInterceptorManager to match the the README#5071
Conversation
|
I could've updated the README to have I had another idea to make use accept a single param with the following typescript interface interface AxiosInterceptorUseParams<V> {
onFulfilled?(value: V): V;
onRejected?: (error: any) => any;
options?: AxiosInterceptorOptions
}But that would've been a major breaking change, so I just incorporated the |
jasonsaayman
left a comment
There was a problem hiding this comment.
This seems pretty reasonable, thanks for the contribution.
|
Actually, I am incorrect, any in this instance cover null too? Let me know if I have it wrong but I am closing for now. |
|
Hi @jasonsaayman
If you still have any concerns, please reach out, I'd be quick to respond 👍 |
|
I will do, adding myself to this for now |
On the Interceptor section on README.md, where we are explaining the usage of the newly introduced
synchronousandrunWhenflags onAxiosInterceptorOptions, we are passing null for the optional parameters for example:When using this in a typescript project you'll get an error saying:
The reason is we didn't specify null as a type for our interceptor handlers.
As per the
typescriptdocsThis PR includes
nullas a type for the interceptor methodsFixes: #5070