Re: [web-bluetooth] discussion: is there possibility to change getAvailability() be sync API (#459)

I'm not sure I agree with removing this event. It's a common model to have functionality available to ascertain an initial state as well as registering an event for when the state changes.

Removing this event may force users to rely on polling the state. Refreshing the browser is a poor UX (and there are implementations of this spec which don't just target browsers!).

Bluetooth on most devices can be turned off, which should change the availability. How would this be handled without the event?

Perhaps the example above should reject the promise when getting availability fails?

-- 
GitHub Notification of comment by thegecko
Please view or discuss this issue at https://github.com/WebBluetoothCG/web-bluetooth/issues/459#issuecomment-546223869 using your GitHub account

Received on Friday, 25 October 2019 06:41:44 UTC