-
Notifications
You must be signed in to change notification settings - Fork 48
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
navigator.getGamepads()
should return a Promise
#23
Comments
I don't know how we could do this without breaking all the existing users of the API. |
Many devs use a different method, like pGetGamepads or getGamepadsP... |
It might needn't. In FF, we just return the gamepads that already emit its first event, so it is not async behavior. |
you can always make a Promise on top off the events gamepadconnected |
if we’re looking to make the Gamepad API safe for DOM contexts (which other issues cover), it probably makes sense to start thinking of creating a similar thing happened for this might warrant its own issue, but this is all could be handled by namespacing the API, moving the DOM events to emit on an thoughts? |
Currently |
Going ahead and closing this, as it would break things.... The events at #152 should make the API better. |
Perhaps this is a dupe of #17, and perhaps this should first be discussed on the mailing list, but I think
navigator.getGamepads()
should return aPromise
resolving an array ofGamepad
objects (instead of returning the array, per the current spec + implementations).The text was updated successfully, but these errors were encountered: