1.0.3 • Published 3 years ago

axios-repeat-prevention v1.0.3

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

Axios Repeat Prevention

Prevent requests if the same request was launched, and it was not completed.

Install

npm install --save axios-repeat-prevention

Usage

Create axios-repeat-prevention instance:

const preserveAdapter = new AxiosRepeatPreserve({
  methods: ['GET'],
});

Create axios instance passing the created adapter:

const api = axios.create({
  adapter: preserveAdapter.adapter
})

With another adapter

Just pass adapter as second argument. As an example using axios-cache-adapter:

import { setupCache } from 'axios-cache-adapter';
const cache = setupCache();
const api = axios.create({
  adapter: config => preserveAdapter.adapter(config, cache.adapter)
})
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago