Created
September 10, 2020 23:22
-
-
Save scroobius-pip/09e02d91ee7e11057ac0d8413bea2a68 to your computer and use it in GitHub Desktop.
This file contains 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 findOrCreateUser(id){ | |
const user = await findUser(id) | |
if(!user){ | |
return await createUser(id) | |
} | |
return user | |
} | |
async function run(idList){ | |
let userList = [] | |
for await (const id of idList){ | |
const user = await findOrCreateUser(id) | |
userList.push(user) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment