-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration points for Promise #115
Comments
Relates to #114 |
We could use dependency injection :) |
@jeffbcross perhaps we could enable dependency injection... But I'm happy to read your suggestion |
I'm not really advocating for DI here, this is just a problem that DI solves easily (overriding bindings). |
@Blesh do you have real-world use cases to drive this design? There are a couple of cases that come to my mind:
Are there other cases I'm missing, or are there reasons why my suggestions don't satisfy those use cases? |
@jeffbcross yes, we do because of what already exists in RxJS. Not only that, but if someone wants to use something other than the standard promise, eg Bluebird, we can specify the object there. PouchDB and others do this as well. |
Thanks @mattpodwysocki, I'm looking for real-world use cases to help me understand the issue. What makes the existing options painful for users? What are the most common reasons for using toPromise in the first place? Interoperability with other libs? Familiarity? |
There are a few use cases for using
|
@Blesh those are use cases for |
I think it's more an issue of a preferred Promise library to use. Bluebird over native for performance reasons, for example. |
Digging into this, the only prudent course for now is a first step, which is global configuration. After that, we can move to an optional functional/factory style configuration, because I think we can support both. But to get this feature in in a minimal way, I'm going to opt for just global configuration so we can get Alpha out the door. |
We need to add a configuration point for using alternative Promise libraries. We also need to allow developers to pass a Promise constructor to each method that might create a Promise internally.
forEach
once such example.forEach
The text was updated successfully, but these errors were encountered: