W3C home > Mailing lists > Public > public-web-bluetooth-log@w3.org > October 2016

[web-bluetooth] Improve the getAvailability() design

From: Jeffrey Yasskin via GitHub <sysbot+gh@w3.org>
Date: Thu, 06 Oct 2016 22:13:22 +0000
To: public-web-bluetooth-log@w3.org
Message-ID: <issues.opened-181538999-1475792001-sysbot+gh@w3.org>
jyasskin has just created a new issue for 

== Improve the getAvailability() design ==
@slightlyoff suggested that because 
 works slightly differently from 
 we should consider naming them differently. I believe he's going to 
take the general question of availability queries to the TAG, so we 
should wait to commit to something here until they take a look.

Because we tend to want the same code to run in both 
`getAvailability().then(<here>)` and 
`navigator.bluetooth.addEventListener('availabilitychanged', <here>)`,
 it might make more sense to use a unified `watchAvailability(...)` 
function that works like an event listener but 1) is guaranteed to be 
called at least once, and 2) can specify registration to have 
side-effects, which event listeners can't.

@mfoltzgoogle @domenic @tabatkins

Please view or discuss this issue at 
https://github.com/WebBluetoothCG/web-bluetooth/issues/307 using your 
GitHub account
Received on Thursday, 6 October 2016 22:13:29 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 6 October 2016 22:13:29 UTC