3 ms·
The author does not seem like an experienced Node.js developer. All those if (err) { done(err); } else { // ... } are usually writ
by olalonde 13y ago
The author does not seem like an experienced Node.js developer. All those
if (err) {
done(err);
}
else {
// ...
}
are usually written in this style:
if (err) return done(err);
// ...
I personally don't like promises and tend to avoid libraries who use them. I don't really see the problem they are trying to solve which is not already solvable in a more flexible way through libraries like async.
- alexgorbatchev 13y agoI agree that libraries should not be handling errors in any unusual way, or better yet just re/throw them and let consumer take care of that. That's where the promises/zones might be useful.
- olalonde 13y agoRight. I don't mind if people want to use promises in their own code as long as they don't force their use on library users.