Re: [sensors] Dependency on [DOM] due to inheriting from EventTarget

I would definitely prefer an eventemitter to extending event target, 
but I'd prefer an Observable to both. Doubling down on EventTarget by 
adding yet more semantics doesn't make sense to sense to me. I also 
think it's easier said than done. 

One nice thing about Observable is that you can declaratively start 
listening to one sensor when a message arrives from another:

var values = sensor1.takeWhile(pos => pos.x - pos.y > 
0).concat(sensor2);

Combinators like concatenation are possible because Observables, like 
Iterables, have a concrete notion of completion. @domenic Would you 
add the notion of completion to EventTarget? How would that be 
communicated? Would unsubscription be implied? Would it integrate is 
well with existing features like generators as observable?

It would really nice to see something concrete in terms of a proposal 
about how event target composition would work (if that is indeed what 
you are proposing). Maybe you could work something up? 

-- 
GitHub Notif of comment by jhusain
See https://github.com/w3c/sensors/issues/21#issuecomment-108047308

Received on Tuesday, 2 June 2015 18:35:28 UTC