
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Automatically debounced timer.
Even if called if called multiple times, only the last call will be executed.
npm install autotimer
// require using commonJS
const AutoTimer = require('autotimer');
// or in es6, using a module bundler like webpack
import AutoTimer from 'autotimer';
// instantiate class
const timer = new Autotimer();
// just call the function with a delay in ms
timer(delay, callback);
// like setTimeout, it returns a timer
const timerOne = timer(delay, callback);
// that you can cancel if needed
clearTimeout(timerOne);
function responsive() {
// do things
}
function scrolled() {
// do things
}
/**
* will call "responsive" only once the browser has finished resizing
* and "scrolled" when the user has finished scrolling
*/
// init timers
const respTimer = new AutoTimer();
const scrollTimer = new Autotimer();
// call them
window.addEventListener('resize', () => {
respTimer(100, responsive);
});
window.addEventListener('scroll', () => {
scrollTimer(200, scrolled);
});
FAQs
Super simple timer that resets itself when called again.
We found that autotimer 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.