私はpromise.allを非同期で待っていることを望むいくつかの約束機能を持っています。しかし、私はそれらのいずれかに 'then'チェーンがあるときにそれを行う方法がわかりません。async promise.all with chain
たとえば、
Promise.all([
promiseFn1(),
promiseFn2().then(promiseFn3)
])
にはどうすればpromiseFn2()
がPromise.all
の内側にチェーンされたときに待つ非同期実装するのでしょうか?私はannoynmous機能させることを考えていますが、希望
ないように:
await Promise.all([
promise1.fn(),
(() =>{
p2response = await promise2Fn();
return promise3Fn(p2response);
})()
])
'Promise.all([ promiseFn1()、 promiseFn3(promiseFn2()を待つ) ]'? –
'promiseFn3()'を 'promiseFn2()'の中の 'then()'に移動します。 –
@PatrickRobertsいいえ、[処理されなかった拒否につながる可能性があります](https://stackoverflow.com/questions/46889290/waiting-for-more) -than-one-concurrent-await-operation) – Bergi