W3C home > Mailing lists > Public > public-device-apis-log@w3.org > March 2017

Re: [sensors] Provide the DeviceOrientation sensor

From: Kenneth Rohde Christiansen via GitHub <sysbot+gh@w3.org>
Date: Wed, 01 Mar 2017 09:00:01 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-283282702-1488358799-sysbot+gh@w3.org>
Sure, this was just an idea and there might be other similar hooks. 
This example is a bit stupid how shows how you could do in JS:
```
const reading = {
  x: 76, 
  y: -22, 
  z: 36,

  [Symbol.iterator]: function*() {
    for (const i of ["x", "y", "z"]) {
      yield this[i];
    }
  }
};
let arr = [...reading];

-> [76, -22, 36]
```

-- 
GitHub Notification of comment by kenchris
Please view or discuss this issue at 
https://github.com/w3c/sensors/issues/170#issuecomment-283282702 using
 your GitHub account
Received on Wednesday, 1 March 2017 09:00:13 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 12:18:52 UTC