favorite-icon-timeout-worker
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

⏱️ Favorite Icon Timeout Worker

NPM version NPM downloads

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)

MIT License

Package Sidebar

Install

npm i favorite-icon-timeout-worker

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

15.9 kB

Total Files

11

Last publish

Collaborators

  • hcodes