Understanding Javascript Generators

preview_player
Показать описание
If you are a JavaScript programmer and you don't like callbacks you should watch this to see the great new alternative for asynchronous programming.

This screencast will show you how to create and interact with generators and your programming life will be better!
Рекомендации по теме
Комментарии
Автор

Excellent, clear explanation. Thanks!

samselikoff
Автор

I agree that the generator function itself is simpler than callbacks, but I feel like that runner function put back in all of the callback complexity and then some. Every example I've seen so far for using generators looks like they don't alleviate complexity, but rather relocate it to another function. I'll admit though that JavaScript isn't my primary development language, so it may just take me using them in one of my toy projects to really see their value. Maybe my problem is that I already write my callbacks to look a lot like generators, but without the ability to yield control or maybe it's just the fact that generators seem like they'd be most useful in more complex situations than the simple examples used in tutorials. Either way, thank you for this tutorial series.

JeffLarkin
Автор

Wonderful.. Thanks.
Does the runner need to recursive? Will node will have a problem if we use something like while(!result.done) ?

vikramn
Автор

Thanks. Very useful and understandable

bedrosenator
Автор

4:48 you are requiring (./weather), why don't you use

import weather from './weather',

I'm aware your video is 2years old, but as you demonstrating EC6, I though it would be nice! Nice demo tho!

frozen_tortus
Автор

I remember having issues with local before and I’m not sure who it was

audreymciver
Автор

There is a bug in weather, check for remote acess in weather

audreymciver
Автор

That’s because someone is stopping me from accomplishing what I need to do. I do not want to be controlled

audreymciver