
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@deleteagency/axios-singular
Advanced tools
A wrapper around axios that makes sure only one request is in progress at the same time
TODO About parallel request and not guaranteed order of receiving reponses
Use the package manager npm for installation.
$ npm install @deleteagency/axios-singular
import axios from 'axios';
import AxiosSingular from '@deleteagency/axios-singular';
const instance = new AxiosSingular(axios);
instance.get("/posts")
.then((response) => {
console.log(response)
},() => {
if (axios.isCancel(error)) {
console.log('Request canceled' , error)
}else{
console.error('Actual error!' , error)
}
})
Returns AxiosSingular.
In order to use custom axios instance you have to pass CancelToken and isCancel as additional arguments. That's because custom instances don't have all base axios properties. Read this comment: https://github.com/axios/axios/issues/1330#issuecomment-362846633
Required
Type: object
Default or any custom axios instance. See details here: https://github.com/axios/axios#creating-an-instance
Optional
Type: object
CancelToken from the base axios instance
Optional
Type: Function
isCancel from the base axios instance
Returns Promise.
Corresponding axios methos is called under the hood with all arguments bypassed. Supported methods: request, get, delete, head, options, post, put, patch See https://github.com/axios/axios#request-method-aliases
Cancel current request if it is in progress
FAQs
A wrapper around axios that makes sure only one request is in progress at the same time
We found that @deleteagency/axios-singular demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.