Комментарии:
30:53 stop :) function get(filename) filename not used
Ответить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.
ОтветитьWhat is the service/software used to build the presentation?
Ответить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.
Ответитьsome information is outdated now-for example co uses promises now instead of thunks, but otherwise still very educational and right on point
ОтветитьThanks! Very comprehensive....and doesnt feel outdated despite the publication date! Very cool summary on promises and Generators...! :)
Ответить