Created
June 13, 2020 18:27
-
-
Save ekzGuille/21761a797a34a50bd3a67bcf16fae573 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Ejecutar un array de promesas en modo cascada | |
Promise.all([]) no serviría en este caso ya que las lanza todas a la vez | |
*/ | |
const arrayPromesas = []; | |
const resolverCascada = async () => { | |
await arrayPromesas.reduce(async (promise, foo) => { | |
await promise; | |
// Hacer lo que sea necseario hacer con 'foo' | |
}, Promise.resolve()); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternativa