This appears to be a simple forkJoin scenario.
To put it simply, you can do the following:
const uploadMultipleFilesToAzure = (uploads: any[]) =>
forkJoin(uploads.map(upload =>
upload.somethingReturningPromise(prms)
);
Instead of using Promises.all, you are now using forkJoin which takes promises as input and emits a single event with an array of results.
Where there was once a nested "then", you will now use xMap - let's say mergeMap. You need to convert from a promise to an observable using from():
const uploadMultipleFilesToAzure = (uploads: any[]) =>
forkJoin(uploads.map(upload =>
from(upload.somethingReturningPromise(prms)).pipe(
mergeMap( ()=> individualCallback(uploadItem);
)
);
If you utilize forkJoin or from(), the promise will be invoked when the function to create the observable is called, rather than when the observable is subscribed to. It is recommended to use defer() instead for this reason:
const uploadMultipleFilesToAzure = (uploads: any[]) =>
forkJoin(uploads.map(upload =>
defer(() => upload.somethingReturningPromise(prms)).pipe(
mergeMap( ()=> individualCallback(uploadItem);
)
);