Hi,
I really appreciate the YDKJS series! This is a complementary to #476 and #434 issues. I've found a questionable explanation for the "delegating recursion" example. Points 6-7:
That promise is yielded out, which comes back to the *foo(2) generator instance.
The yield passes that promise back out to the foo(3) generator instance. Another yield passes the promise out to the bar() generator instance. And yet again another yield * passes the promise out to the run(..) utility, which will wait on that promise (for the first Ajax request) to proceed.
Following the run(...) utility logic and the example above I do not think it is correct to say that the promise is passed back to the "parents" generator istances before completion, because basically run(..) simply creates a new Promise waiting the fulfillment of request( "http://some.url/?v=" + val ) and then, after fulfillment, the fullfillment value is passed to the paused yield statement. Only now, the value is returned to the "parent" generator instance.
Hi, I really appreciate the YDKJS series! This is a complementary to #476 and #434 issues. I've found a questionable explanation for the "delegating recursion" example. Points 6-7:
Following the run(...) utility logic and the example above I do not think it is correct to say that the promise is passed back to the "parents" generator istances before completion, because basically run(..) simply creates a new Promise waiting the fulfillment of request( "http://some.url/?v=" + val ) and then, after fulfillment, the fullfillment value is passed to the paused yield statement. Only now, the value is returned to the "parent" generator instance.