is-idle
v1.0.3
Published
General purpose idle detection. Timeout based.
Downloads
12
Readme
Is idle
General purpose idle detection. Timeout based.
Installation
$ npm i is-idle
Usage
import isIdle from "is-idle"
// setup
const isScrollIdle = isIdle()
document.body.addEventListener("scroll", () => {
isScrollIdle.stillActive()
})
// use
isScrollIdle.get((isIdle) => {
if (isIdle) console.log("Is idle")
else console.log("Is not idle")
})
Uses josm Data
(as return value) for subscription handeling. For advanced usage read respective doc.
Contribute
All feedback is appreciated. Create a pull request or write an issue.