idlejs:当用户闲置或交互时执行内容

时间:2024-05-22 02:58:50
【文件属性】:

文件名称:idlejs:当用户闲置或交互时执行内容

文件大小:106KB

文件格式:ZIP

更新时间:2024-05-22 02:58:50

typescript interactive idle no-dependencies TypeScript

idlejs 仅当在给定的超时时间内某些目标元素上的某些事件已发生或未发生时才执行功能。 它简单,可配置,对打字稿友好,并具有易于链接的API。 安装 yarn add idlejs npm install --save idlejs v2到v3 将导入从idlejs/dist更改为idlejs import { ... } from 'idjejs' 空闲 在给定时间内没有发生任何指定事件时(即,用户空闲时), do回调函数( do )。 用法 import { Idle } from 'idlejs' ; // with predefined events on `document` const idle = new Idle ( ) . whenNotInteractive ( ) . within ( 5 ) . do ( ( ) => logoutUser (


【文件预览】:
idlejs-master
----.github()
--------workflows()
----yarn.lock(257KB)
----src()
--------base.ts(2KB)
--------index.ts(69B)
--------idle.spec.ts(5KB)
--------idle.ts(1KB)
--------not-idle.ts(1KB)
--------not-idle.spec.ts(5KB)
----.npmignore(33B)
----tsconfig.json(604B)
----LICENSE(1KB)
----README.md(2KB)
----.gitignore(34B)
----package.json(1KB)

网友评论