Re: [wake-lock] Add example usage of onrelease event. (#250)

How about this:

```js
const sentinel = await navigator.wakeLock.request('screen');
checkbox.checked = true;

const listener = (ev) => {
  checkbox.checked = false;
  ev.target.remoteEventListener('release', listener);
};

sentinel.onrelease = listener;
```

(not sure whether it's clearer to use `onrelease` or `addEventListener` for symmetry)

-- 
GitHub Notification of comment by rakuco
Please view or discuss this issue at https://github.com/w3c/wake-lock/issues/250#issuecomment-581858718 using your GitHub account

Received on Tuesday, 4 February 2020 11:11:34 UTC