Jump to ratings and reviews
Rate this book

JAVASCRIPT WITH PROMISES: MANAGING ASYNCHRONOUS CODE

Rate this book
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.

120 pages, Paperback

First published March 22, 2014

34 people are currently reading
83 people want to read

About the author

Daniel Parker

146 books24 followers
Daniel Parker is a pseudonym of Daniel Ehrenhaft.

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
20 (24%)
4 stars
36 (43%)
3 stars
24 (29%)
2 stars
1 (1%)
1 star
1 (1%)
Displaying 1 - 10 of 10 reviews
Profile Image for Anton Antonov.
350 reviews48 followers
November 25, 2015
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.
Profile Image for Evan Carroll.
6 reviews17 followers
April 17, 2016
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.
Profile Image for Jess Blevins.
10 reviews3 followers
February 2, 2016
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.
16 reviews
March 4, 2016
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.
Profile Image for Lim Hooi.
6 reviews1 follower
September 8, 2015
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.
Profile Image for Mike Lisanke.
1,271 reviews29 followers
January 22, 2023
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.
Profile Image for Shane.
56 reviews
February 11, 2018
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.
Profile Image for Lime Street Labrador.
200 reviews6 followers
February 1, 2022
A short and succinct discussion on JS promises with easy-to-follow examples, without blindly dumping syntax, like many shit books do.

The chapter on the BlueBird promise library and last chapter on iterators and generators are unnecessary.
Profile Image for Mohammad Khatib.
7 reviews1 follower
November 26, 2016
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.
Displaying 1 - 10 of 10 reviews

Can't find what you're looking for?

Get help and learn more about the design.