Forbes Lindesay: Promises and Generators: control flow utopia -- JSConf EU 2013

Forbes Lindesay: Promises and Generators: control flow utopia -- JSConf EU 2013

JSConf

11 лет назад

33,240 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@Damorfati
@Damorfati - 15.10.2013 20:47

30:53 stop :) function get(filename) filename not used

Ответить
@MrCranigus
@MrCranigus - 21.11.2014 20:02

Great video, but one quibble: You can take the use of generators even further and eliminate promises entirely. We really won't need promises, async or co libraries or any of that. Generators will get us back to using normal control flow operators with calls that are performing async work. I suppose people are so invested in promises now that they can't imagine a world without them, but you really won't need them once generators are available to you.

Ответить
@dziamid
@dziamid - 17.11.2015 11:09

What is the service/software used to build the presentation?

Ответить
@truthadjustr
@truthadjustr - 14.06.2016 01:59

The simplest way to put it is this: If you wrap an [a]synchronous function call inside a Promise object, it will return synchronously a promise object and not yet the result. But, a .then( ) block attached to this object will get called later when the promise is fulfilled. While your code logic continues to flow downwards, you are confident that the .then( ) block will get invoke later on. So, the Promise( ) is just a callback mechanism, YES, but it is certain type of callback that allows you to avoid your code from having a deep nesting and have a more readable flatter code. This is thanks, to the .then( ) block that you attached into the Promise object. Promise objects are only that, for you to have a more flat appearing code. Without it, then you will have to continue all necessary code logic to be deeply nested, just to handle the result. Because the .then( ) block can intercept that result for us, no more need to dive into deeply nested circus.

Ответить
- 14.09.2016 13:03

some information is outdated now-for example co uses promises now instead of thunks, but otherwise still very educational and right on point

Ответить
@amyniovi8087
@amyniovi8087 - 23.10.2018 13:29

Thanks! Very comprehensive....and doesnt feel outdated despite the publication date! Very cool summary on promises and Generators...! :)

Ответить