Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

ES2015 Generator Concepts - NYC Node.js Meetup 20150316

A brief overview of how generators work in ES2015/ES6, with a special focus on how co works.

  • Sé el primero en comentar

  • Sé el primero en recomendar esto

ES2015 Generator Concepts - NYC Node.js Meetup 20150316

  1. 1. ES2015 Generator Concepts Valeri Karpov Platform Tech Lead, Booster Fuels @code_barbarian
  2. 2. What This Talk is About ● What is a generator? ● What can you do with it? ● How does co work?
  3. 3. Terminology ● Generator function ● Generator object (or just generator)
  4. 4. The Yield Keyword ● yield allows re-entry
  5. 5. The Key Idea of Generators ● Yield pauses generator function execution ● Calling next() resumes execution ● Can call next() asynchronously
  6. 6. Why Is This Useful?
  7. 7. Separate Logic From Scheduling
  8. 8. Yielding a Promise
  9. 9. What’s Next? ● Check out The 80/20 Guide to ES2015 Generators ● Rigorous guide to generators as spec-ed with minimal outside dependencies ○ No babel, webpack, angular, react, gulp, etc. etc. ● More detail on how co works ● Plus koa, the web framework based on co ● Plus regenerator, Facebook’s transpiler
  10. 10. Thanks for Listening! Comments, questions, haikus? Read more at: @code_barbarian