pTimeout:https:github.comsindresorhusp timeout的Deno端口 源码

solo67171 8 0 ZIP 2021-02-23 20:02:35

P(romise)超时 在指定的时间后使promise超时 用法 import pTimeout from 'https://deno.land/x/p_timeout@1.0.0/mod.ts const delayedPromise = new Promise ( resolve => setTimeout ( resolve , 500 ) ) pTimeout ( delayedPromise , 50 ) . then ( ( ) => 'foo' ) //=> [TimeoutError: Promise timed out after 50 milliseconds] API

用户评论
请输入评论内容
评分:
暂无评论