Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
batch-queue
Advanced tools
queue actions to be run in batches
var batch = require('batch-queue')(raf)
, thing = {}
function raf() {
requestAnimationFrame(function() {
console.log(thing) // {}
batch.run()
console.log(thing) // {a: 1, c: 3}
})
}
batch.queue(function() {
thing.a = 1
})
var foo = batch.add(function(key) {
this[key] = 3 // context is preserved
})
foo.call(thing, 'b') // wont be run because foo is called again
foo.call(thing, 'c')
ready will be called the first time something is queued after the queue has been drained. ideally it should be used in combination with a timeout or requestAnimationFrame. if all is set to true, ready will be called even if the queue was not empty. useful if you want to batch by number of actions rather than time.
queue a function to be called next time the batch is run. the function is called without a context, use fn.bind if you need a specific context to be set
works like a debaunce. batch.add will return a new function, when this function is called it will queue the original function to be called with the passed arguments and context. calling this function multiple times will result in the function only running once when the batch executes with the last set of arguments passed.
runs any queued jobs, returns true
if any jobs were run, otherwise returns false
FAQs
queue actions to be run in batches
The npm package batch-queue receives a total of 0 weekly downloads. As such, batch-queue popularity was classified as not popular.
We found that batch-queue 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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.