The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

ES6 (ES2015) - Generators

ES6 (ES2015) - Generators

5:28
Generators in ECMAscript 6 are first-class coroutines that produce encapsulated suspended execution contexts. Whew! Yield values and iterate over them until no more values exist in the generator. We'll talk more about practical use later ;)
Watch this lesson now
Avatar
egghead.io

Generators in ECMAscript 6 are first-class coroutines that produce encapsulated suspended execution contexts. Whew! Yield values and iterate over them until no more values exist in the generator. We'll talk more about practical use later ;)

Avatar
Dzmitry Budzko

Hey, how did you do this bulk editing on 03:00 where you added value to 4 lines simultaneously?

In reply to egghead.io
Avatar
Brian

It's a feature of his text editor. You hit ctrl + left click.

In reply to Dzmitry Budzko
Avatar
Brian

Can't wait until the next generator lesson. I'd especially be interested in seeing a lesson on generators in conjunction with RxJS.

In reply to egghead.io
Avatar
Saiful

This may sound off topic, but up until this video, i've noticed that ecma script 6 looks a lot like python.. any reason or story behind it?

Avatar
James

I was following along with the ES6 lessons nicely up to this one. Then........wat?

Avatar
Jesse

John Lindquist mentions there will be follow up lessons on practical use cases of Generators. I realize there are whole courses on RxJS, etc but can we see some practical uses of Generators soon?

Avatar
James

John Lindquist mentions there will be follow up lessons on practical use cases of Generators. I realize there are whole courses on RxJS, etc but can we see some practical uses of Generators soon?

I'm wondering the same thing. There is an RxJS Observables + Generators lesson by Mr. CycleJS.

In reply to Jesse
Avatar
Michael

I was following along with the ES6 lessons nicely up to this one. Then........wat?

same

In reply to James
Avatar
James Bedont

lost the thread of the course on this video. I really could have used some sort of practical example of generators.

Avatar
Joel

lost the thread of the course on this video. I really could have used some sort of practical example of generators.

Hey James, generators had me scratching my head for a practical use for a long time. Then I saw them used for redux-sagas. Mind blown! http://joelhooks.com/blog/2016/03/20/build-an-image-gallery-using-redux-saga

In reply to James Bedont
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?