1.0.2 • Published 4 years ago

axios-single-request v1.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

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',
})
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago