@seedalpha/throttle
v1.0.10
Published
throttle/debounce events
Downloads
2
Readme
throttle
queue/debounce events
Installation
$ npm install seed-throttle --save
Usage
var throttle = require('seed-throttle');
function fn(items, cb) {
// array of items in the queue
// cb when done
}
var queue = throttle({
timeout: 20000, // flush every 20 seconds (if queue is not empty)
size: 20 // flush if queue is at least 20 events long
}, fn);
queue.push(item);
queue.push(item2, item3, item4)
queue.push([item5, item6, item7]);
queue.flush(function() {
// force flush and get a callback when all done
});
Author
Vladimir Popov [email protected]
License
©2016 SeedAlpha