0.2.1 • Published 6 years ago

throttle-checker v0.2.1

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

throttle-checker

simple throttle checker for Typescript

import { ThrottleChecker } from 'throttle-checker';

function throttleCallback() {
  console.log('throttled!');
}

const checker = new ThrottleChecker({
  period: 10 * 60, // sec
  throttle_time: 10 * 60, // sec
  threshold: 5,
}, throttleCallback);

for (let i = 0; i < 10; i++) {
  if (checker.check()) {
    console.log('filtered: ' + i);
  }
}
0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago