Check out a free preview of the full Rethinking Asynchronous JavaScript course

The "Exercise 7" Lesson is part of the full, Rethinking Asynchronous JavaScript course featured in this preview video. Here's what you'd learn in this lesson:

In this exercise, you will now use generators to write the async flow control code from the previous exercises.


Transcript from the "Exercise 7" Lesson

>> [MUSIC]

>> Kyle Simpson: So how are we feeling about generator Let's try an exercise and see how we're feeling about generators. We're gonna go one more time, deep back in the well one more time. This running example that we've had of making the three calls in parallel and sequencing their responses.

I cannot wait for you to see how cool the solution is with generators. This is the hardest thing for me to do, to wait ten more minutes while you try it, cuz I just wanna show it to you right now. But I wanna give you a chance to practice thinking about generators the way I just talked about, try to see if you can get your brain wrapped around.

How would I do things in parallel, but then wait for them to sequence their output? So try exercise seven with a generator. You can use a sequence to run it cuz that's pretty convenient, it's already included there for you. The last five or six slides should have more than enough info to help you with that.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now