With this implementation of run() , you can run a generator containing multiple yield statements, such as:
run(function*() {
console.log(1);
yield;
console.log(2);
yield;
console.log(3);
});
This example just outputs three numbers to the console,
This example just outputs two numbers to the console, 1 and 2.
When the second yield is executed, the done become true and the function run is complete.
Hello, i think there maybe a typo. you can see the incrorrect sentence before it. https://leanpub.com/understandinges6/read#leanpub-auto-task-running-with-data
This example just outputs two numbers to the console, 1 and 2. When the second
yield
is executed, thedone
becometrue
and the functionrun
is complete.