Unlike promises that are executed in parallel (via
Promise.all()), to my knowledge there is no method for this on the
Promise object. So you have to build this functionality yourself.
This is how I solved this problem for myself:
The following was important to me in this solution:
Promises are wrapped in an anonymous function, so that they are not executed until the previous Promise has been resolved.
- As soon as an error occurs and a Promise cannot be resolved, the sequence is stopped, no further Promises are executed and the errors that occurred are propagated.