Skip to content

Commit

Permalink
Fix manual transformation description (resolve -> request)
Browse files Browse the repository at this point in the history
The explanation of the process() manual transformation function includes references to a "resolve" function that is not used in the example. 

It's clear from context that the explanation is referring to the "yield request" statement replaced by "return request".
  • Loading branch information
airandfingers committed May 9, 2015
1 parent 594669c commit 8b5c7df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion async & performance/ch4.md
Expand Up @@ -2100,7 +2100,7 @@ Each state in our generator is represented by its own `case` in the `switch` sta

For any generator-wide variable declarations (`val`), we move those to a `var` declaration outside of `process(..)` so they can survive multiple calls to `process(..)`. But the "block scoped" `err` variable is only needed for the `*3*` state, so we leave it in place.

In state `*1*`, instead of `yield resolve(..)`, we did `return resolve(..)`. In terminal state `*2*`, there was no explicit `return`, so we just do a `return;` which is the same as `return undefined`. In terminal state `*3*`, there was a `return false`, so we preserve that.
In state `*1*`, instead of `yield request(..)`, we did `return request(..)`. In terminal state `*2*`, there was no explicit `return`, so we just do a `return;` which is the same as `return undefined`. In terminal state `*3*`, there was a `return false`, so we preserve that.

Now we need to define the code in the *iterator* functions so they call `process(..)` appropriately:

Expand Down

0 comments on commit 8b5c7df

Please sign in to comment.