3 ms·
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 ot
by grandalf 11y ago
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.
- phs2501 11y agoIMHO, 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/Reference/Global_Objects/Promise/resolve 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.
- grandalf 11y agothanks much for the explanation. I will try bluebird.