在Node应用程序中,我需要以同步方式迭代某些项,但循环内的一些操作是异步的.我的代码现在看起来像这样:
someAPIpromise().then((items) => {
items.forEach((item) => {
Promise.all[myPromiseA(item), myPromiseB(item)]).then(() => {
doSomethingSynchronouslyThatTakesAWhile();
});
}
}
Run Code Online (Sandbox Code Playgroud)
当items
数组为1 时,这会产生奇迹.但是,一旦有多个项目,promise.all()
就会立即为数组中的每个项目启动,而不必等待循环中的操作结束.
所有这些......我怎样才能确保数组中每个项的整个操作是同步运行的(即使某些操作是异步并返回一个promise)?
非常感谢!
ñ
上传一个应用程序并提交给FastLlane deliver
我进行审核后,我正试图启动内部测试pilot
.但是,只要我使用如下命令执行此操作:
pilot distribute -a com.foo.bar.awesomesauce -u me@example.com -w test_test_test
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Error finding relevant GitHub issues: undefined method `map' for nil:NilClass
[!] The request could not be completed because:
Beta App Description is required. The phone number is missing. The email must be in the format: contact@example.com. The email is required. Beta App Description is required. The email must be in the format: contact@example.com. The email is required. The phone number is missing. Validation errors
Run Code Online (Sandbox Code Playgroud)
例外是不言而喻的,跳入iTunes …
asynchronous ×1
es6-promise ×1
fastlane ×1
ios ×1
javascript ×1
node.js ×1
promise ×1
testflight ×1