Created
October 29, 2019 09:27
-
-
Save llcoollasa/c50ab2b3aa2167d424d113a7862e9cfb to your computer and use it in GitHub Desktop.
Resolving Promise inside map in Type Script
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
const A = await Promise.all(accountUsers.map(async (user) => { | |
const { state, csrfSecret } = await oauth.generateState(); | |
return { | |
accountId: user.accountId, | |
firstName: user.firstName, | |
lastName: user.lastName, | |
email: user.email, | |
csrfSecret, | |
state, | |
}; | |
})); | |
const B = A.map((user) => { | |
return { | |
user.accountId, | |
user.firstName, | |
user.lastName, | |
user.email, | |
user.csrfSecret, | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment