0.0.1 • Published 10 years ago

throttle-arguments v0.0.1

Weekly downloads
6
License
-
Repository
bitbucket
Last release
10 years ago
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);