Closed
Description
hi, I would like to add a suggestion that Record will have a map function, it's already have forEach so I think its not too difference.
my use case is doing async stuff inside the forEach and I want to await there
const promises = recored.map(async (v) => {
// ... stuff
await stuff(v)
//... more stuff
})
await Promise.all(promises)
which I cant do with forEach,
what I did instead for now is
const promises = Object.values(record.toObject()).map(async (v) => {
// ... stuff
await stuff(v)
//... more stuff
})
await Promise.all(promises)
which is kinda hack
Metadata
Metadata
Assignees
Labels
No labels