Skip to content

Commit

Permalink
es6+beyond: ch4, fixing tech mistake in code snippets, closes getify#645
Browse files Browse the repository at this point in the history
  • Loading branch information
getify committed Feb 13, 2016
1 parent 9696b9f commit c4e917c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions es6 & beyond/ch4.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ It *is* possible to express a series of promises in a chain to represent the asy
step1()
.then(
step2,
step2Failed
step1Failed
)
.then(
function step3(msg) {
Expand All @@ -288,15 +288,16 @@ Consider the previous snippet's async flow control expressed with a generator:

```js
function *main() {
var ret = yield step1();

try {
ret = yield step2( ret );
var ret = yield step1();
}
catch (err) {
ret = yield step2Failed( err );
ret = yield step1Failed( err );
}

ret = yield step2( ret );

// step 3
ret = yield Promise.all( [
step3a( ret ),
Expand Down

0 comments on commit c4e917c

Please sign in to comment.