W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2014

Re: Ambient light API redesign

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 26 Aug 2014 13:58:17 -0700
Message-ID: <CA+c2ei_3Qu1wW8dyiw-t_HetWsSxZbUxm--tbh4Qty_Q-JQ2fQ@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: public-script-coord <public-script-coord@w3.org>, "public-device-apis@w3.org" <public-device-apis@w3.org>, Anssi Kostiainen <anssi.kostiainen@intel.com>, Doug Turner <dougt@mozilla.com>, Rick Waldron <waldron.rick@gmail.com>
On Tue, Aug 26, 2014 at 2:43 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
>
> Perhaps something like this:
>
>   var as = new AmbientSensor()
>   var currentVal = await as.value
>   as.onvaluechange = ...

Would as.value just return a Promise reflecting the first reading? And
after that it would quickly be outdated? If so that could potentially
be confusing. Or does the property return a new, immediately resolved,
Promise every time that onvaluechange fires?

/ Jonas
Received on Tuesday, 26 August 2014 20:59:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:22 UTC