【文件属性】:
文件名称:timeout-emitter:设置一个超时,当达到超时或调用.clear()时发出超时或清除事件。
文件大小:2KB
文件格式:ZIP
更新时间:2021-05-17 23:07:58
JavaScript
超时发射器
设置一个超时,当达到超时或调用.clear()时发出超时或清除事件。
例子
var Timeout = require ( 'timeout-emitter' )
var timeout = new Timeout ( 5000 ) // Pass timeout in ms
timeout . on ( 'expire' , function ( ) {
// Called _once_ if the timeout is reached
} )
timeout . on ( 'clear' , function ( ) {
// Called _once_ when timeout.clear() is called
} )
// Some time in the future you may want to clear the timeout:
timeout
【文件预览】:
timeout-emitter-master
----.gitignore(23B)
----package.json(677B)
----index.js(561B)
----LICENCE(748B)
----README.md(563B)