1.0.0 • Published 3 years ago

axios-request-throttle v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

axios-request-throttle

Throttle axios request-per-second rate with 3 lines of code. The main difference with this module and others like axios-throttled is that you don't have to create a new axios instance, and by extension don't have to fix imports project-wide. Apply once and every axios.get, post, put, delete etc is throttled.

Installation

yarn add axios-request-throttle

or

npm i axios-request-throttle

Usage

import axios from 'axios';
import axiosThrottle from 'axios-request-throttle';

axiosThrottle.use(axios, { requestsPerSecond: 5 });