Skip to content
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

Make connect() return a device handle #65

Closed
jyasskin opened this issue Jan 29, 2015 · 0 comments
Closed

Make connect() return a device handle #65

jyasskin opened this issue Jan 29, 2015 · 0 comments

Comments

@jyasskin
Copy link
Member

#2 made requestDevice not imply a connection, but that implies that common uses look like:

navigator.bluetooth.requestDevice(...)
.then(device => {device.connect().then(()=>device);})
.then(device => { /* real use */ });

If connect() returns a BluetoothDevice or similar, then the common use would look like:

navigator.bluetooth.requestDevice(...)
.then(device => device.connect())
.then(device => { /* real use */ });

which is a bit simpler.

jyasskin added a commit to jyasskin/web-bluetooth-1 that referenced this issue Mar 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant