4 ms·
But jump to this http://wingolog.org/archives/2013/05/08/generators-in-v8 http://wingolog.org/archives/2013/05/08/generators-in-v8 which explains it properly -
by bdfh42 13y ago
But jump to this http://wingolog.org/archives/2013/05/08/generators-in-v8 http://wingolog.org/archives/2013/05/08/generators-in-v8 which explains it properly - and tells you why you would want to do it.
- afshinmeh 13y agoagreed
- k__ 13y agoDoes it need to be used with promises?
- apaprocki 13y agoNo. Promises work nicely with generators, but you can use generator functions freely.
- k__ 13y agoIs there any promise-less guide, that helps to grasp the concept of function* and yield in JS?
- Touche 13y agoNot an article, but this is a good library that uses generator functions without promises: https://github.com/visionmedia/co https://github.com/visionmedia/co
- masklinn 13y agoAny generator guide for Python will work, the syntax is slightly different (no function/def, the generator is "created" by the presence of a `yield` keyword in the body, and `yield*` is called `yield from`)
- k__ 13y agoThe easiest thing to do is probably playing around with it :)