This generator will repeat another generator up until some condition. This is the version
that can handle async generators.
For example, count will count from 0..number and then finish:
for (constvofcount(5)) { // v: 0, 1, 2, 3, 4 }
But what if we want to repeat the count? We have to provide a function to create the generator,
rather than using the generator directly, since it's "one time use"
This generator will repeat another generator up until some condition. This is the version that can handle async generators.
For example, count will count from 0..number and then finish:
But what if we want to repeat the count? We have to provide a function to create the generator, rather than using the generator directly, since it's "one time use"
Limiting the number of repeats can be done by passing in extra parameters