wi
worker-interval
npm i worker-interval
wi

worker-interval

setInterval and clearInterval implementation with using Web-Workers to keep up and running on inactive tabs for Chrome, Firefox and IE

by Gorkem CINAR

1.0.6 (see all)License:MITTypeScript:Not Found
npm i worker-interval
Readme

worker-interval

setInterval and clearInterval implementation with using Web-Workers to keep up and running on inactive tabs for Chrome, Firefox and IE

Motivation

Most of the modern browsers (Chrome, Firefox and IE), intervals are clamped to fire no more often than once per second in inactive tabs. For that reason, decided to implement a library to avoid throttling on timers.

Getting Started

npm install worker-interval

Example

import * as workerInterval from 'worker-interval';

// setInterval
const intervalId = workerInterval.setInterval(/*function*/, 1000);

// clearInterval
workerInterval.clearInterval(intervalId);

Downloads/wk

160

GitHub Stars

14

LAST COMMIT

4yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

2

OPEN PRs

0
VersionTagPublished
1.0.6
latest
4yrs ago
No alternatives found
No tutorials found
Add a tutorial