Created
March 5, 2020 02:48
-
-
Save jwulf/b934f3a0e3551c25ab7aa85fba90ed36 to your computer and use it in GitHub Desktop.
A code example from the article https://www.joshwulf.com/blog/2020/03/array-async-failure/
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
async function myAsyncFunction(argument) { | |
let arrayTasks = [ | |
{ | |
const run = async () => { | |
let response = await getDataAsync(); | |
} | |
}, | |
{ | |
const run = async () => { | |
let response = await getDataAsync(); | |
} | |
} | |
] | |
for (const index in arrayTasks) { | |
await arrayTasks[index].run(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment