A worker for favicon animations without brakes. Used for inactive tabs when the browser slows down.
npm install timeout-worker
import { FaviconTimeoutWorker } from 'favorite-icon-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();
worker.setTimeout(callback: () => void, delay: number)
worker.clearTimeout(id: number)
worker.setInterval(callback: () => void, delay: number)
worker.clearInterval(id: number)
MIT License