I have the following method that loops through a list of objects and for each node you need to execute a promise. What is the best way to execute two or more asynchronous operations in a row within a for loop?
async cargarEstadosPools() {
let that = this;
let nodo: Nodo;
for (var i = 0; i < that.aplicacionEntorno.entorno.nodos.length; i++) {
this.appService.loading = true;
nodo = that.aplicacionEntorno.entorno.nodos[i];
await that.obtenerDatos.Metodo(this.ruta + 'api/nodo' + '/' + aplicacionId)
.then((res: any) => {
if (res != 'Started' && res != 'Stopped') {
nodo.errorPool = res;
nodo.estadoPool = 'Error';
}
else {
nodo.errorPool = '';
nodo.estadoPool = res;
}
nodo.ejecutandoAccionNodo = false;
that.appService.loading = false;
})
}
}