favicon-timeout-worker
v1.0.0
Published
Timeout worker for favicon
Downloads
2
Maintainers
Readme
⏱️ Favicon Timeout Worker
A worker for favicon animations without brakes. Used for inactive tabs when the browser slows down.
Installation
npm install timeout-worker
Using
import { TimeoutWorker } from 'favicon-timeout-worker';
const worker = new FaviconTimeoutWorker();
const timeoutId1 = worker.setTimeout(() => {
console.log('tick from setTimeout');
}, 500);
// ...
worker.clearTimeout(id1);
// ...
const timeoutId2 = worker.setInterval(() => {
console.log('tick from setInterval');
}, 50);
// ...
worker.clearInterval(timeoutId1);
// ...
worker.terminate();
API
.setTimeout(callback: () => void, delay: number)
.clearTimeout(id: number)
.setInterval(callback: () => void, delay: number)
.clearInterval(id: number)
License
MIT License