Asynchronous JavaScript is everywhere, whether you’re using Ajax, AngularJS, Node.js, or WebRTC. This practical guide shows intermediate to advanced JavaScript developers how Promises can help you manage asynchronous code effectively—including the inevitable flood of callbacks as your codebase grows. You’ll learn the inner workings of Promises and ways to avoid difficulties and missteps when using them.
The ability to asynchronously fetch data and load scripts in the browser broadens the capabilities of JavaScript applications. But if you don’t understand how the async part works, you’ll wind up with unpredictable code that’s difficult to maintain. This book is ideal whether you’re new to Promises or want to expand your knowledge of this technology.
Understand how async JavaScript works by delving into callbacks, the event loop, and threadingLearn how Promises organize callbacks into discrete steps that are easier to read and maintainExamine scenarios you’ll encounter and techniques you can use when writing real-world applicationsUse features in the Bluebird library and jQuery to work with PromisesLearn how the Promise API handles asynchronous errorsExplore ECMAScript 6 language features that simplify Promise-related code
Daniel Parker's JS with Promises does a great job of introducing promises in a rich with code examples manner. Then it expands into more advanced promises scenarios that are mostly showcased as 'how to do it naively' and 'how to do it right', which in my opinion is the right way to approach this.
The promise libraries featured in the book are mostly Promises/A+ compliant ones - Bluebird, Q and ES6 promises. Of course the black sheep jQuery is there too for 'finger pointing' purposes on why not to use jQuery promises in your projects (if possible). Ok I may have exaggerated, but really jQuery promises are not Promises/A+ spec compliant and are definitely not there to stay.
Since it's 2015, every JS book has to have a ES6 features chapter. Of course JS with Promises has one too. However it's not just something put there for no reason except the JS ES6 hype, but it's actually well integrated with the concept of the book. The ES6 chapter starts with showing pre-ES6 ways to do things and how to do them with ES6 and it all revolves around promises. It's definitely worth reading since it makes using Promises even more fun. If anyone really wants to dive deep in ES6 - Understanding ES6 by Nicholas C. Zakas goes through every ES6 feature in more details.
Overall it has the right balance between code examples and explanations. The book is enough to make you friends with Promises and start to utilise them "properly" and not in a naive manner as the book showed on multiple places to teach the reader.
I'm certain that JS with Promises can be considered a must read for JS developers. It's aimed for a bit more advanced JS developers, but it's definitely worth reading by everyone at some point.
The book is a bit dated. ES7 introduces async and await (both available in node and mentioned in a few sentences), and Observables. Moreover, the book is needlessly complex in many areas: the section on chaining is obtuse. Worse, the section on ES6 is misplaced and too abbreviated: there is no mention of arrow-syntax changing the context of 'this'. Some things seem kind of obscure even to me, such as when conditionally chaining promises is a "Good Idea" especially, after the chapter right before reiterates why it's a bad idea: conditionally chaining a promise is essentially the same as chaining it synchronously with a no-op function. And, on the subject of chaining, explaining `array.reduce()` seems to waste valuable space when the book is only 80 pages.
The author should focus on the subtitle "Managing Asynchronous Code." To that end, it should be better paced. It starts off really well, and it goes downhill fast. There are two use cases of asynchronicity: client and server. Both of these have different demands and tools: there is no mention of server side libraries Co or Koa (or Koa v2), or Thunks. There is also no mention of client-side libraries that use Bluebird (or promises) and the ilk.
It's not very good at describing the ecosystem on the server, or the client. And, it is near devoid of advice -- good or bad. Another book of about the same size, JavaScript: The Good Parts, is fixed on making suggestions about implementation and practice. If this book is to stay the same size, it should become opinionated and reorient itself. It is lacking far too much for it to be authoritative on anything or introductory for asynchronous Javascript.
The author does a good job summarizing the benefits of using promises over traditional asynchronous callbacks in JS. The example code in Chapter 3 ("Working with Standard Promises)") is probably the most helpful part of the book since it covers common programming scenarios.
Unfortunately, the explanations of the standard Promise API were sometimes difficult to follow (like a lot of technical documentation).
Overall, I wish I had read this book _before_ i started working with promises because it's a good introduction, but there's not a lot more to it.
Everything you need to know about promises to work effectively with them. The book is quite short and easy to read, and at the same time it goes deep enough into the topic of promises and async programming in JS at all.
This is a good book describing Promise in Javascript and mentioned two or three libraries providing the Promise feature and highlight some of the differences between them.
Ok, this is the book (or at least a book) I was looking for to learn and resolve problems I'm having with Asynchronous runtime execution and passing data between asynch code and the mainline sequential event loop. I've been told it's a non-trivial problem which is often left as an exercise for the newly minted Javascript programmer. It Should Not be. Fortunately this author goes into some detail describing the problem and the evolving Javascript language which "solved" it. The book and its description is complex but the author provides a detailed description (from what a 1st read provides). I look forward to reading more books on the subject and returning to this book to absorb the intricacies of asynch code and promises in Javascript.
Good information, but some of the examples were a bit abstract and would have been better if they included more real world scenarios. I also found that the chapter ordering could have been better. It started with some basic concepts, moved on to some more advanced concepts, and then went back to basics at the end of the book.
Must read if you're starting to work with promises
If you've been working with promises for awhile though, it might not offer much to learn but might solidify your understanding of how some parts of the promise APIs work. Really easy to read with small and clear examples to help you understand promises.