W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2014

Re: [whatwg] Proposal: Wake Lock API

From: Marcos Caceres <w3c@marcosc.com>
Date: Wed, 20 Aug 2014 11:09:20 -0400
To: Olli Pettay <olli@pettay.fi>
Message-ID: <DBE450FC0CA34970ABF928DCFF191FC8@marcosc.com>
Cc: WHAT Working Group <whatwg@lists.whatwg.org>, Mounir Lamouri <mounir@lamouri.fr>, Jonas Sicking <jonas@sicking.cc>



On Wednesday, August 20, 2014 at 5:15 AM, Olli Pettay wrote:

> On 08/20/2014 11:33 AM, Anne van Kesteren wrote:
> > On Wed, Aug 20, 2014 at 10:29 AM, Jonas Sicking <jonas@sicking.cc (mailto:jonas@sicking.cc)> wrote:
> > > FWIW, the web platform sorely needs a construct for "readonly state
> > > variable + event whenever the state changes". I.e. some form of
> > > observable which remembers the last produced value. I had hoped the
> > > Streams would get us closer to that, but the current definition seems
> > > to be too different.
> > 
> > 
> > 
> > Isn't that Object.observe() with custom records produced by the
> > specific object you are defining for the property you want to enable
> > this for (in this case held, it seems like)?
> 
> 
> 
> Object.observe() + some custom records sounds rather inconsistent API. Why would one getter in some
> prototype be handle differently to other getters?
> (and it is not too clear how one would implement that.)


Agree - a custom thing would not be great. And of course Object.observe would work really nicely, but I've been told a bunch of times by various people that we can't use Object.observe on DOM APIs (this *really* sucks). 

Getting a bit off topic, but it would be nice if we had a "DOM Observer" (kinda like a mutation observer) that returned you the same record as Object.observe and could be used with the attributes of WebIDL defined objects. It would make designing, and using, these APIs much simpler. 
Received on Wednesday, 20 August 2014 15:09:48 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:22 UTC