throttle-arguments
v0.0.1
Published
Function throttler based on arguments
Downloads
4
Readme
function Class() {
this.state = 'internal state: param1 = %s, param2 = %s, counter = %s';
this.cnt = 0;
}
Class.prototype.log = function(param1, param2) {
console.log(this.state, param1, param2, this.cnt);
};
var cls = new Class();
var throttled = new Throttle(cls.log.bind(cls), 3000);
setInterval(function() {
cls.cnt++;
}, 400);
setInterval(throttled, 100, 1, 2);