mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
updated interceptor use type definition to remove interceptor options parameter from use method for response interceptors (#5237)
* updated interceptor use type definition to remove interceptor options parameter from use method for response interceptors * incorporated type changes to index.d.cts --------- Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
@@ -764,7 +764,7 @@ axios.interceptors.request.use(function (config) {
|
||||
```
|
||||
|
||||
If you want to execute a particular interceptor based on a runtime check,
|
||||
you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return
|
||||
you can add a `runWhen` function to the options object. The request interceptor will not be executed **if and only if** the return
|
||||
of `runWhen` is `false`. The function will be called with the config
|
||||
object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an
|
||||
asynchronous request interceptor that only needs to run at certain times.
|
||||
@@ -779,6 +779,8 @@ axios.interceptors.request.use(function (config) {
|
||||
}, null, { runWhen: onGetCall });
|
||||
```
|
||||
|
||||
> **Note:** options parameter(having `synchronous` and `runWhen` properties) is only supported for request interceptors at the moment.
|
||||
|
||||
### Multiple Interceptors
|
||||
|
||||
Given you add multiple response interceptors
|
||||
|
||||
Reference in New Issue
Block a user