Skip to content

hairyf/axios-extras

Repository files navigation

🛹 Axios Extras

Has axios extra (axios interceptors) used by most business scenarios

npm version npm downloads bundle JSDocs License

✨ Features

  • 🔄 Response Handling - Customize and transform API responses
  • 🚦 Loading States - Automatic loading state management
  • 🧹 Parameter Filtering - Remove unnecessary parameters from requests
  • 🔑 Authentication - Handle token refresh and auth headers
  • 🔁 Request Optimization - Caching, retrying, and request packing

💬 Why?

I'm tired of duplicate code and scattered packages. so. I decided to create a collection of axios interceptors that can be used in various business scenarios.

📦 Install

npm install axios-extras

🚀 Usage

import axios from 'axios'
import { withParamsExtra } from 'axios-extras'

// Add extra parameters to request headers
withParamsExtra(axios, () => ({ token: localStorage.getItem('token') }), 'headers')

🛠️ Methods

License

MIT License © Hairyf

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published