Re: [sensors] Add solution for one-shot readings

Good points from @rwaldron.

Just noting the `MessagePort` has this interesting (not very intuitive
 IMO) behaviour:

>... when using `addEventListener()`, the `start()` method must also 
be invoked. When using `onmessage`, the call to `start()` is implied.

Applying that pattern to the solution 1 the call to `start()` would be
 implied with `onreading`. We'd need to `start()` when using 
`addEventListener()` though.

Seems more clear to require `start()` for both `onreading` and 
`addEventListener('reading', ...)`, thus the solutions 1 and 2 should 
actually be the same. I'd probably name the method simply `start()`.

Also wondering if there are good use cases for explicit `pause()` and 
`resume()` or `stop()` and how would the solution 1+2 compare with 3 
in that case.

-- 
GitHub Notification of comment by anssiko
Please view or discuss this issue at 
https://github.com/w3c/sensors/issues/88#issuecomment-192972157 using 
your GitHub account

Received on Sunday, 6 March 2016 19:44:32 UTC