1.0.1-0 • Published 2 years ago

@qaz7456/axios-concurrent-queue v1.0.1-0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

axiosQ

Queue concurrent requests for axios with interceptors.

Installation

axiosQ is available as a package on NPM for use with a module bundler or in a Node application:

npm install @qaz7456/axios-concurrent-queue

What's Included

  • How many ways can axiosQ be used?
    axiosQ(axios);
    axiosQ(axios, MAX_CONCURRENT);
  • What do we pass to axiosQ as an argument?

    axios: An instance of axios.

    MAX_CONCURRENT: An optional parameter to control the number of concurrent requests, the default is 1.

  • What does axiosQ return?

    axios: An instance of axios.

    detach: A function, will eject the request and response handlers from axios instance.

Usage

import axios from 'axios';
import { axiosQ } from '@qaz7456/axios-concurrent-queue';

const control = axiosQ(axios.create({
  baseURL: BASE_API,
  withCredentials: true
}));

const axiosInstance = control.axios;

License

compression-app is Apache-2.0 licensed, as found in the LICENSE file.