axios-inherit
Version:
šØāš¦ Add interceptor inheritance to axios
15 lines (10 loc) ⢠741 B
Markdown
šØāš¦ Add [interceptor](https://github.com/axios/axios#interceptors) inheritance to axios
```js
import axios from 'axios'
import axiosInherit from 'axios-inherit'
axiosInherit(axios)
```
1. "Inherit" any existing interceptors of global axios instance when creating a new axios instance.
2. Apply new interceptors to existing instances when adding interceptors to global axios instance.
3. Do the same for adding interceptors ("use") and removing them ("eject")