axios-single-request

1.0.2 • Public • Published

axios-single-request

Canceling previous requests with an identical ID

Installation

npm install axios-single-request

Usage

import {requestInterceptorFulfilled, responseFulfilled, responseRejected} from 'axios-single-request';

axios.interceptors.request.use(requestInterceptorFulfilled);
axios.interceptors.response.use(responseFulfilled, responseRejected);


// Now all previous failed requests will be canceled when sending each new request with the "singleRequestId" parameter.

axios.get('url', {
  singleRequestId:'request_id',
})

axios.post('url', {}, {
  singleRequestId:'request_id',
})

Readme

Keywords

Package Sidebar

Install

npm i axios-single-request

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

21.1 kB

Total Files

10

Last publish

Collaborators

  • sergeypeskov