~/talk

Promises and Generators: control flow utopia

Talkat JSConf EU 2013 · 2013-09-14..09-15· [javascript, typescript]
slides:none on file

Claims that ES6 generators plus promises let asynchronous code read like synchronous code: actual implementation shows a small generator wrapper that resumes with generator.next or throw, yielding promises and propagating errors correctly. Demonstrates converting callback-style readFile/JSON parsing into promise-returning functions, then into generator + yield code that supports try/catch, for/loops and straightforward parallelism by starting promises before yielding. Compares failed alternatives (streamline, suspend, co) and shows the approach works in practice.

AI-written summary · about

  1. 0:00Generators and lazy loops
  2. 2:43Asynchronous challenges
  3. 4:58Managing callback flaws
  4. 8:55Introduction to promises
  5. 9:49Streamlining with then
  6. 19:00Async await with generators
  7. 23:21How generators work
  8. 28:52Alternative async tools
  9. 30:54Conclusion
~/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.