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

@dotmh/tick

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dotmh/tick

A utility library for making polling loops

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

DotMH.dev

DotMH Tick.

DotMH Tick is designed for making polling loops when needed easier.

Installation

npm i @dotmh/tick

Usage

To use Tick you first have to require it.

const Tick = require('@dotmh/tick')

Then create a new instance of the class

const tick = new Tick();

Then set up tick

tick.every('2ms').start(() => console.log('hello world'));

You can stop the tick with

tick.stop()

You can also set a condition which mean the callback will be called if the condition function return true.

tick.every('2s').when(() => true).start(() => console.log('do something'));

See vercel/ms to see more about the format for the time string.

Keywords

Polling

FAQs

Package last updated on 17 Dec 2022

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