~/talk

Async + Await

Talkat dotJS 2017 · on Friday, 2017-12-01· [javascript, nodejs]
slides:none on file

Explains why async/await gives synchronous-looking, nonblocking JavaScript and demonstrates concrete patterns: using Promise.all to parallelize two Axios fetches, an example sleep promise, error strategies including try/catch, a higher‑order catchErrors wrapper that forwards exceptions to Express next, and listening for process unhandledRejection. Shows converting callback APIs with util.promisify, measures that parallel requests finish in the longer of the two timings, and confirms the wrapper approach cleanly captures thrown errors and passes them into Express error middleware.

AI-written summary · about

  1. 0:00Introduction
  2. 1:00Why Await
  3. 3:22Browser APIs
  4. 3:46Promises
  5. 5:40JavaScript vs PHP
  6. 6:38Await Function
  7. 8:25Trycatch
  8. 9:07HandleError
  9. 10:03How it works
  10. 11:05Express
  11. 12:23Implementation
  12. 12:52Handle the error
  13. 13:19Unhandled rejection
  14. 14:21Tips
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.