JSFiddle - React, Tailwind, and code Playground
JavaScript
function* saga1() {
yield 1;
return 2;
}
function* saga2() {
yield 1;
yield 2;
}
const iter = saga2();
while(true) {
const current = iter.next();
console.log(current);
if (current.done) {
return;
}
}