-
Notifications
You must be signed in to change notification settings - Fork 18
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
Expose when.all() and/or when.join() #1
Comments
Thinking a little more about that, I guess something like
would make me happy, without polluting namespaces and such... |
Yes, that's the direction I've been thinking too. One one side I don't want to expose any dependencies of Mopidy.js since that's really an implementation detail, but from a more pragmatic point of view, you got a good point about the library needed to work effectively with promises already being there, just not very available. |
Yeah, "pragmatic" is the right word... It seems like there's a gazillion of deferred/promises libraries out there that follow the specs on the client interface side, but don't provide much interoperability. For example, AngularJS has Guess I could try and implement some implementation-agnostic helper functions for that, but I'm quite busy with that other project, so I'd really appreciate if you chose to expose this... |
Thinking a little more about it (two days of Zeitausgleich really help ;-)), if you're unsure about whether to expose the internal dependencies of Mopidy.js, adding a |
I think I'll go with exposing when. If we ever move away from it, users of |
Disclaimer: I'm not that much of a JS guru, so if I'm completely wrong on this issue or there are already much easier ways to do what I'm trying to achieve, I'd be glad to be corrected or pointed to the right direction...
The
when.js
CommonJS Promises/A implementation used bymopidy.js
provides some useful "static" methods, which are not available easily through themopidy.js
interface. I especially like to usewhen.all()
and/orwhen.join()
, which somewhat resemblepykka.join()
, which I like ;-)I currently use what I consider a very ugly hack to get that functionality without loading
when.js
seperately, to do something like this:Now, it would be nice if
all
and/or the similarwhen.join()
would be exposed by Mopidy directly, since I think this use case might not be uncommon for clients. I guessall
could be easily added as a property to either theMopidy
constructor or amopidy
instance.As stated before, I don't know if there's an easier or cleaner way to achieve this. However, what I don't want to do is add another
since the functionality is already there...
The text was updated successfully, but these errors were encountered: