Re: addEventListener and side effects (was: CfC to change Sensor approach, not progress current draft)

Le jeudi 22 mars 2012 à 09:49 -0700, Doug Turner a écrit :
> >> yes, but it is simpler and follows a known pattern. 
> > 
> > So does my proposal (it's modeled on the battery API).
> 
> The battery API isn't shipping everywhere.  Device orientation (and
> soon device motion) is shipping in Firefox, Opera, and Chrome.  

Sure; but that only shows one was started earlier than the other, not
that it provides a better model.

> > (if in fact activation-on-addEventListener is OK, I'll update
> > http://scriptlib-cg.github.com/api-design-cookbook/ to reflect this)
> 
> Sure.  It is what Device Motion and Orientation is doing.  Why would
> it now be bad for other APIs to do this?  Lets strive for consistency.

localStorage has a design but that makes it susceptible to race
conditions; localStorage is deployed everywhere. Would we want to adopt
that bug nevertheless?

A reason why we wouldn't want to do it again is if it has been proved a
bad idea but one from which we can't easily backtrack due to existing
deployment.

DOm

Received on Thursday, 22 March 2012 16:52:55 UTC