Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

live-check

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

live-check

Some case we need check if `Dom` on the document. so that we can use `setInterval` check this `dom` length property, like this:

Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

live-check

Some case we need check if Dom on the document. so that we can use setInterval check this dom length property, like this:

if (dom.length) {
  // do something
}

if dom on the document you can do what you want to do.

use live-check can easy to do that case.

Install

npm install live-check

//or yarn 
yarn install live-check

Your code


// i you want to check dom on the document use this

import liveCheck from 'live-check'

liveCheck(()=> {
  document.querySelector(".username")
},{
  checkTimes: 10,
  checkInterval: 1*500
}).then(()=>{
  // now you can operation the document here or implement you bussiness logic
}).catch(()=>{
  // oops the document not exist the `username` dom with class 
})

Options

optionstypedefaultdescription
checkTimesnumber500live query check condition times
checkIntervalnumber50(ms)live query check one time interval

FAQs

Package last updated on 10 Jan 2021

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