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

Re: [wake-lock] API to get list of active wake locks (#133)

From: Kenneth Rohde Christiansen via GitHub <sysbot+gh@w3.org>
Date: Fri, 08 Mar 2019 14:47:16 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-470952846-1552056435-sysbot+gh@w3.org>
If you add an `AbortSignal` when you request now, then you would need to hold on to that instead. Not sure if that is much better, but it makes a list of `WakeLockRequest` useless.

With my latest PR, WakeLock will be constructable, so you can create a new wake lock for the same underlying platform wakelock, and that way get hold of a reference to the platform wakelock. This might be able to help some.

Currently `request()` is not async (though it can trigger async behavior) and thus returns immediately, making it possible to call `request()` from the same WakeLock object multiple times.

This should become a promise if we want to add a prompt. 

I wonder if it really makes sense that a `WakeLock` can call `request()` multiple times and what would be the best way to solve it - just throw?

Should a `WakeLock` object have a way to `abortAll()`?

GitHub Notification of comment by kenchris
Please view or discuss this issue at https://github.com/w3c/wake-lock/issues/133#issuecomment-470952846 using your GitHub account
Received on Friday, 8 March 2019 14:47:18 UTC

This archive was generated by hypermail 2.4.0 : Monday, 4 July 2022 12:47:56 UTC