Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

great! BTW would you use bluebird or es6 promises if starting a new project today?


inglor is a contributor to Bluebird, so I'd guess he'd say Bluebird. Bluebird is the much faster option and has a lot more features, if you're using babel (and a recent node/io.js) you can transpile async/await to bluebird coroutines for maximum performance and syntactic beauty.


Is there any chance Bluebird will become the standard in the future? Not sure if it makes sense to use a nonstandard approach, but would love to be convinced otherwise.


IMHO, very doubtful; Bluebird has a lot of (very useful) features that would be pretty burdensome to put into a specification.

On the other hand, there's really no reason not to use Bluebird. It's easy to ensure that a promise you receive is a Bluebird promise:

    import Bluebird from 'bluebird';
    const bluebirdPromise = Bluebird.resolve(promise);
If `promise` is a Bluebird promise that will be a no-op, and if it's a foreign promise or thennable you'll get a new Bluebird promise that will resolve/reject when the foreign one does. (This is standard behavior; see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...)

Since Bluebird promises are thennables, the reverse will be true if they're consumed by a different promise library.

Given Bluebird's speed, superior debuggability, and features, there's really no reason not to use it a this point.


thanks much for the explanation. I will try bluebird.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: