Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
@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 1 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
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.