W3C home > Mailing lists > Public > public-device-apis@w3.org > June 2015

Re: [sensors] When there are multiple sensors of a given type, how do we identify which one to instantiate?

From: davidmarkclements via GitHub <sysbot+gh@w3.org>
Date: Fri, 05 Jun 2015 14:07:59 +0000
To: public-device-apis@w3.org
Message-ID: <issue_comment.created-109304260-1433513278-sysbot+gh@w3.org>
What about this?

```js
var pSensors = Sensor.Proximity.list(); // => [ {id: <Symbol()>, meta:
 { position: 'back-left'}} ]

//Sensor.Proximity( <Symbol or Object with {id: <Symbol>  )
var mySensor = Sensor.Proximity(pSensors[0]); //deliberately not using
 new
//and/or : var mySensor = Sensor.Proximity(pSensors[0].id);
```



```

-- 
GitHub Notif of comment by davidmarkclements
See https://github.com/w3c/sensors/issues/26#issuecomment-109304260
Received on Friday, 5 June 2015 14:08:06 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:54:05 UTC