Fix semicolons, remove old note in 1.11.8
This commit is contained in:
parent
9a6a9fb584
commit
37c6a31de5
3 changed files with 4 additions and 4 deletions
|
@ -12,7 +12,7 @@ function loadJson(url) {
|
||||||
} else {
|
} else {
|
||||||
throw new Error(response.status);
|
throw new Error(response.status);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
loadJson('no-such-user.json')
|
loadJson('no-such-user.json')
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
# Rewrite "rethrow" with async/await
|
# Rewrite "rethrow" with async/await
|
||||||
|
|
||||||
Below you can find the "rethrow" example from the chapter <info:promise-chaining>. Rewrite it using `async/await` instead of `.then/catch`.
|
Below you can find the "rethrow" example. Rewrite it using `async/await` instead of `.then/catch`.
|
||||||
|
|
||||||
And get rid of the recursion in favour of a loop in `demoGithubUser`: with `async/await` that becomes easy to do.
|
And get rid of the recursion in favour of a loop in `demoGithubUser`: with `async/await` that becomes easy to do.
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ function loadJson(url) {
|
||||||
} else {
|
} else {
|
||||||
throw new HttpError(response);
|
throw new HttpError(response);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ask for a user name until github returns a valid user
|
// Ask for a user name until github returns a valid user
|
||||||
|
|
|
@ -156,7 +156,7 @@ class Thenable {
|
||||||
// resolve with this.num*2 after 1000ms
|
// resolve with this.num*2 after 1000ms
|
||||||
setTimeout(() => resolve(this.num * 2), 1000); // (*)
|
setTimeout(() => resolve(this.num * 2), 1000); // (*)
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
async function f() {
|
async function f() {
|
||||||
// waits for 1 second, then result becomes 2
|
// waits for 1 second, then result becomes 2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue