https://github.com/fiverr/axios-inherit
👨👦 Add interceptor inheritance to axios
https://github.com/fiverr/axios-inherit
axios inheritance interceptors
Last synced: about 1 month ago
JSON representation
👨👦 Add interceptor inheritance to axios
- Host: GitHub
- URL: https://github.com/fiverr/axios-inherit
- Owner: fiverr
- Created: 2020-05-20T06:43:46.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-21T22:58:39.000Z (about 2 years ago)
- Last Synced: 2025-04-04T18:11:57.196Z (2 months ago)
- Topics: axios, inheritance, interceptors
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 5
- Watchers: 37
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# axios-inherit [](https://circleci.com/gh/fiverr/axios-inherit) [](https://www.npmjs.com/package/axios-inherit)
👨👦 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")