Async iterator destructuring?

Bergi a.d.bergi at
Sat Feb 8 02:00:02 UTC 2020


> It might be useful on some occasions to [collect] async iterators [into an array].
No need for destructuring or spreading here. The iterator helpers
proposal <> already
covers these:

return Buffer.concat(await someStream.setEncoding('buffer').toArray())

// It's different for each database
const [item] = await db.scan({
    filter: {key: value},
    limit: 1,

kind regards,

More information about the es-discuss mailing list