- From: Reilly Grant via GitHub <sysbot+gh@w3.org>
- Date: Mon, 12 Feb 2024 17:23:05 +0000
- To: public-device-apis-log@w3.org
I propose closing this issue as "won't fix". A Promise-returning API can easily be polyfilled like so,
```js
function getCurrentOrientation() {
return new Promise((resolve) => {
document.addEventListener('deviceorientation', (event) => {
resolve(event);
}, {once: true});
});
}
```
The [Observable](https://github.com/WICG/observable) proposal would also extend all `EventTarget`s so that you could write:
```js
let event = (await document.on('deviceorientation').take(1).toArray())[0];
```
--
GitHub Notification of comment by reillyeon
Please view or discuss this issue at https://github.com/w3c/deviceorientation/issues/11#issuecomment-1939192174 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 12 February 2024 17:23:08 UTC