
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
@dotdev/ajax-queue
Advanced tools
const queue = new Q([config]);
queue.add([request]);
config
- objectThe config object is not required
Name | Description | Type | Default |
---|---|---|---|
success | The callback for all successful ajax requests processed by this queue | function | Dispatch a Q:requestCompleted event |
error | The callback for all unsuccessful ajax requests processed by this queue | function | Dispatch a Q:requestFailed event |
completedAllRequestsEvent | The event type that will be dispatched once all requests have finished | string | Q:requestsCompleted |
completedRequestEvent | The event type that will be dispatched after each request is finished | string | Q:requestCompleted |
failedRequestEvent | The event type that will be dispatched after a request has failed | string | Q:requestFailed |
requestStartedEvent | The event type that will be dispatched after each request has started | string | Q:requestStarted |
errorEvent | The event type that will be dispatched after Q has thrown an error | string | Q:error |
add
Adds a request to the currently running queue, this will cause the queue to process each item, one at a time until all requests have been resolved.
const queue = new Q()
// Build the ajax request
const request = {
url: '/cart/add.js',
data: item,
success: options.success,
error: options.error
}
// Add the request to the ajax request queue
this.queue.add(request)
})
request
- objectName | Description | Required | Type | Default |
---|---|---|---|---|
success | The callback for a successful response, overwrites the queue default. | false | function | Dispatch a Q:requestCompleted event |
error | The callback for an unsuccessful response, overwrites the queue default. | false | function | Dispatch a Q:requestFailed event |
url | The url that the request will be sent to | true | string | null |
method | The method that will be used to make the request | false | string | GET |
data | Any data that you wish to send to the request | false | any | null |
dataType* | The type of data that we expect to recieve from the request | false | string | '' |
Options:
''
, 'arraybuffer'
, 'blob'
, 'document'
, 'json'
, 'text'
FAQs
Front end ajax queue and request handler
The npm package @dotdev/ajax-queue receives a total of 5 weekly downloads. As such, @dotdev/ajax-queue popularity was classified as not popular.
We found that @dotdev/ajax-queue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.