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

Re: [web-bluetooth] Improve the getAvailability() design

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Mon, 10 Oct 2016 17:56:07 +0000
To: public-web-bluetooth-log@w3.org
Message-ID: <issue_comment.created-252693742-1476122165-sysbot+gh@w3.org>
The problem is that it's not "some inconsistency now", it's 
*guaranteed* inconsistency until we actually get the new primitive 
this wants to rely on.  This sort of "eh, go ahead and do something 
that kinda works" is why we have several APIs from the brief period 
between "promises are cool" and "here's promises" which have weird, 
inconsistent callback APIs. The convenience gain from switching to 
bespoke callbacks was very small, compared to the gain from actual 
promises; it would have been better for those to have stuck with 
events, which can be upgraded into promises in a consistent way.

Same here.  This wants to send the current value when you subscribe 
(like a fulfilled promise does) but also wants to send updates (which 
events do). The correct primitive is an Observable, but we haven't 
gotten that finished up for the ES spec yet. It's better, as Domenic 
says, to just apply existing platform patterns to this API for now, 
rather than inventing something bespoke (that's still inadequate, when
 compared to the "correct" solution) which'll just look like an 
awkward one-off in a few years.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at 
https://github.com/WebBluetoothCG/web-bluetooth/issues/307#issuecomment-252693742
 using your GitHub account
Received on Monday, 10 October 2016 17:56:14 UTC

This archive was generated by hypermail 2.3.1 : Monday, 10 October 2016 17:56:14 UTC