wait-for-cond:等到条件满足

时间:2021-05-04 10:07:28
【文件属性】:
文件名称:wait-for-cond:等到条件满足
文件大小:3KB
文件格式:ZIP
更新时间:2021-05-04 10:07:28
testing waiting JavaScript 等待条件 等待直到满足条件。 对于测试很有用。 安装 $ npm i -S wait-for-cond 用法 承诺将确定是否在指定的持续时间内至少满足一次条件,否则将拒绝。 var waitFor = require ( 'wait-for-cond' ) ; var someCondition = true ; waitFor ( function ( ) { return someCondition ; } , 2000 , 'an optional reject message' ) . then ( function ( ) { console . log ( 'condition is fulfilled.' ) ; } ) . catch ( function ( ) { console . error ( 'condition was not ful
【文件预览】:
wait-for-cond-master
----.gitignore(29B)
----package.json(592B)
----index.test.js(6KB)
----index.js(3KB)
----README.md(2KB)

网友评论