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

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