像Promise.all(array)一样,但是带有一个对象而不是一个数组。-JavaScript开发

时间:2024-06-14 21:01:58
【文件属性】:
文件名称:像Promise.all(array)一样,但是带有一个对象而不是一个数组。-JavaScript开发
文件大小:150KB
文件格式:ZIP
更新时间:2024-06-14 21:01:58
JavaScript Miscellaneous 类似于Promise.all([])的组合承诺,但适用于对象。 从'combine-promises'导入CombinePromise; const {用户,公司} =等待CombinePromise组合承诺与Promise.all([])类似,但对象不同。 从'combine-promises'导入CombinePromise; const {用户,公司} =等待CombinePromises({用户:fetchUser(),公司:fetchCompany(),}); 原因:对解构顺序不敏感简单的异步功能代码功能:TypeScript支持轻量级功能齐全经过良好测试的ESM / CJS安装npm install Combine-promises //或yarn add Combine-promises TypeScript支持良好,本机且严格的TypeScript支持
【文件预览】:
combine-promises-main
----.github()
--------workflows()
----yarn.lock(374KB)
----src()
--------index.ts(949B)
----tsconfig.json(1KB)
----LICENSE(1KB)
----test()
--------index.test.ts(3KB)
----README.md(2KB)
----.gitignore(34B)
----package.json(1KB)

网友评论