Attempting to write a recursive async generator function, I hit a roadblock when I realized I am unsure of the syntax for yield*
in the context of an async generator.
In a conventional generator function, I can utilize yield*
to yield all values from another generator:
function* A() {
yield 1;
yield 2;
yield 3;
}
function* B() {
yield* A();
yield* A();
}
[...B()] // === [1,2,3,1,2,3]
However, when dealing with an async generator, how exactly can I yield all values?