favorite-icon-timeout-worker
v1.0.6
Published
Timeout worker for favicon
Downloads
3
Maintainers
Readme
⏱️ Favorite Icon 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 { 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();
API
worker.setTimeout(callback: () => void, delay: number)
worker.clearTimeout(id: number)
worker.setInterval(callback: () => void, delay: number)
worker.clearInterval(id: number)
License
MIT License