I am trying out the "new" async generator/for dance:
async function* it() {
yield "Hello";
yield "World";
}
async function test() {
for await (const x of it()) {
console.log()
}
}
I am getting the following error:
error TS2504: Type must have a '[Symbol.asyncIterator]()' method that returns an async iterator.
How can I make work?
What's the right "typesafe" return type for the "it" function?