rauschma / exploring-js

20 stars 0 forks source link

Chapter: Asynchronous programming in JavaScript #26

Open rauschma opened 6 years ago

AndiPersti commented 3 years ago

39.1.3 Callback-based asynchronous functions :

In the code snippet the second parameter of the callback is named result. But later on in the text, the parameter is called r:

A result r: Then the following task is added to the queue. taskQueue.enqueue(() => callback(null, r));

I'd suggest to use result in both places.

rauschma commented 2 years ago

@AndiPersti True, thanks! Fixed in next release.

0fye commented 2 years ago

In 39.2 "The call stack" section:

https://exploringjs.com/impatient-js/ch_async-js.html#the-call-stack

Error.prototype.stack is non-standard:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack

It's implemented in all platforms though. Maybe mention this fact a little bit?

rauschma commented 2 years ago

@0fye Yes! Mentioned here: https://exploringjs.com/impatient-js/ch_exception-handling.html#error-stack

0fye commented 2 years ago

Ahh nice, thanks!!! @rauschma

atengberg commented 3 months ago

As I've said before thank you for such tremendous educational resource(s)!

Is there a reason there is no mention of AbortController? As a standard mechanism in the browser and apparently even server side js, and as not much would need to be added--as complete as the rest of the book is, a paragraph example would seem to fit well with the rest of the async content?

Also in a previous issue you give reference to an async queue implementation; perhaps consider redrafting as an extra (supplemental?) subchapter, as such a (without library dependency) model, would be a good way to demonstrate culmination of chapters and provide a very useful example as far as something that could be used to bridge to next level of JavaScript mastery.

To that end, perhaps your next book in the series could be along the lines of optimal approach to software/project architecture for either JS-TS-node?

Thanks again for such well written educational material. Really could be a "gold" standard for genuine text-book quality.