Тёмный
No video :(

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

JSConf
Подписаться 282 тыс.
Просмотров 33 тыс.
50% 1

Slides: pag.forbeslinde...
I will talk about how ES6 generators can help you make your asynchronous code easier to understand in terms of synchronous concepts. I will discuss the alternative values you can use to represent a future and how they are all ultimately promises. Finally, I will discuss how you can get some of the same benefits in thought processes by using promises today.
Source: 2013.jsconf.eu/...
License: For reuse of this video under a more permissive license please get in touch with us. The speakers retain the copyright for their performances.

Опубликовано:

 

28 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 16   
@truthadjustr
@truthadjustr 8 лет назад
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.
@vaim5982
@vaim5982 3 года назад
I think this is the most efficient explanation of promise found till now.
@amyniovi8087
@amyniovi8087 5 лет назад
Thanks! Very comprehensive....and doesnt feel outdated despite the publication date! Very cool summary on promises and Generators...! :)
8 лет назад
some information is outdated now-for example co uses promises now instead of thunks, but otherwise still very educational and right on point
@MrCranigus
@MrCranigus 9 лет назад
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.
@aptennap
@aptennap 9 лет назад
Sean O'Dell Do you have anymore information on this?
@ImpostorModanica
@ImpostorModanica 9 лет назад
Sean O'Dell Labbekak Yeah Sean, fill us in
@WayneKSeymourIIIProgrammer
@WayneKSeymourIIIProgrammer 5 лет назад
Hey Sean, can you explain, even with a trivial example? I'm very interested.
@chrislowth
@chrislowth 7 лет назад
Great vid. One minor comment - at 8:00 - the "subtle flaw" - no. The code doesnt do what's explained. The callback is only called once.
@beppe85you
@beppe85you 7 лет назад
He states clearly that when JSON parses correctly and the callback throws an error, the callback will be called again this time with an error argument
@DaveJacoby
@DaveJacoby 10 лет назад
Always love to learn more about Javascript. Clearly an effective speaker talking about the newest things in the language. JS is _not_ my language, though, so there are things I don't know. In his example slides (I'm seeing it at 1:56 as a first time), I see code like: function* count () { /*code here*/ } and I have no clue what _function*_ means. Help?
@BrianWisti
@BrianWisti 10 лет назад
I do not know, and I'm right in the middle of studying JavaScript syntax myself. Let's find out. Google lets me down. Dang. DuckDuckGo leads me to It's a new ES6 notation for generator functions.
@JosephDykstra
@JosephDykstra 10 лет назад
I am confused about where the async() function comes from in slide 15, pag.forbeslindesay.co.uk/#/15, timestamps 17:20 through 17:50. Forbes Lindesay
@nightire
@nightire 10 лет назад
pag.forbeslindesay.co.uk/#/22
@dziamid
@dziamid 8 лет назад
What is the service/software used to build the presentation?
@Damorfati
@Damorfati 11 лет назад
30:53 stop :) function get(filename) filename not used
Далее
what will you choose? #tiktok
00:14
Просмотров 6 млн
Using async generators to stream data in JavaScript
27:37
The Power of JS Generators by Anjana Vakil
36:10
Просмотров 164 тыс.
Asynchrony: Under the Hood - Shelley Vohr - JSConf EU
25:24
The Async Await Episode I Promised
12:04
Просмотров 1,1 млн
what will you choose? #tiktok
00:14
Просмотров 6 млн