Skip to content

Instantly share code, notes, and snippets.

@scroobius-pip
Created September 10, 2020 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scroobius-pip/09e02d91ee7e11057ac0d8413bea2a68 to your computer and use it in GitHub Desktop.
Save scroobius-pip/09e02d91ee7e11057ac0d8413bea2a68 to your computer and use it in GitHub Desktop.
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