Merge pull request #2257 from vsemozhetbyt/1.11.8
Fix semicolons, remove old note in 1.11.8
This commit is contained in:
commit
48b111d85f
3 changed files with 4 additions and 4 deletions
|
@ -12,7 +12,7 @@ function loadJson(url) {
|
|||
} else {
|
||||
throw new Error(response.status);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
loadJson('no-such-user.json')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
# 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.
|
||||
|
||||
|
@ -22,7 +22,7 @@ function loadJson(url) {
|
|||
} else {
|
||||
throw new HttpError(response);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// Ask for a user name until github returns a valid user
|
||||
|
|
|
@ -156,7 +156,7 @@ class Thenable {
|
|||
// resolve with this.num*2 after 1000ms
|
||||
setTimeout(() => resolve(this.num * 2), 1000); // (*)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async function f() {
|
||||
// waits for 1 second, then result becomes 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue