New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

visible-timer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

visible-timer

Simple timer scheduler, that makes ensure that time will be executed only when document is not hidden

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

visible-timer

Simple timer scheduler, that makes ensure that time will be executed only when document is not hidden

  • Installation
  • Usage
  • Advanced Usage

Installation

npm install visible-timer

Usage

  // You can use those as you usually do
  import {
    clearInterval,
    clearTimeout,
    setInterval,
    setTimeout,
  } from 'visible-timer';

  // But callback won't be executed unless document.hidden is false
  const timeout = setTimeout(() => console.log(42));
  clearTimeout(timeout);

Advanced

  // You can use those as you usually do
  import {
    timerCreator,
  } from 'visible-timer/timer-creator';

  // But callback won't be executed unless document.hidden is false
  const {
    clearInterval,
    clearTimeout,
    setInterval,
    setTimeout,
    setPausedState,
  } = timerCreator();

  // You can create custom sceduler by calling setPausedState with boolean

  setPausedState(true) // will pause all timeouts
  setPausedState(false) // will unpause all timeouts

LICENSE

MIT

Keywords

timer

FAQs

Package last updated on 07 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts