proposal-await.ops:介绍await.all await.race await.allSetteded await.any以简化Promises的使用

时间:2021-04-28 08:30:58
【文件属性】:
文件名称:proposal-await.ops:介绍await.all await.race await.allSetteded await.any以简化Promises的使用
文件大小:17KB
文件格式:ZIP
更新时间:2021-04-28 08:30:58
HTML await.ops提案 。 介绍await.all / await.race / await.allSettled / await.any以简化Promises的使用 阶段1 冠军: ,( 动机 为了简化一组Promises的使用。 (先前的讨论: : ) 为了简化异步功能中并发for循环的用法。 用法: // before await Promise . all ( users . map ( async x => fetchProfile ( x . id ) ) ) // after await . all users . map ( async x => fetchProfile ( x . id ) ) 句法: await . all expr // eq: await Promise.all(expr) await . race expr // eq: a
【文件预览】:
proposal-await.ops-main
----.gitignore(661B)
----package.json(486B)
----.npmrc(19B)
----LICENSE(1KB)
----.github()
--------workflows()
----README.md(1KB)
----index.html(53KB)
----.gitattributes(87B)
----spec.emu(3KB)

网友评论