Closed
Description
After support this, we can do:
const room = await Room.find('test room')
for await (const contact of room) {
console.log('Contact', contact, 'is in room', room)
}
See
- Symbol.iterator will allow you to override the of operator
- for-await-of and synchronous iterables
- [Asynchronous iteration for JavaScript(https://github.com/tc39/proposal-async-iteration)