Hacker News new | ask | show | jobs
by antihero 4641 days ago
Say, hypothetically (I haven't done any tests or anything) that Bluebird was faster than the included promise specification, is there some sort of dependency injection to replace it, seeing as it's a spec?
1 comments

Without a doubt Bluebird, When.js, Q, then/promise and others are faster. The implementation in httpinvoke is optimized for code size.

The other reason for current solution is that the specification for creating and resolving promises [1] is not yet published.

Having a Promise object in global scope, as exported by Q, Bluebird and then/promise, is not enough. There is no uniform way to hack into these implementations and use their promises resolver.

But when resolvers-spec is available, httpinvoke will definitely check for already loaded promises library and reuse it.

[1] https://github.com/promises-aplus/resolvers-spec