Re: [wake-lock] WakeLock.request() returns a promise that never resolves (#226)

No, because then we get back to the situation of having to manage a bunch of objects. 

Let’s just attach .requestLock() to Window, and the just fire events at the Window object (or let’s just add .wakelock. to Navigator. The .requestLock() can just async give you back some key, and then we can just have .removeLock(key); when done. 

That gets rid of the whole having to manage objects, and can just use simple events. If the lock is held, we can just keep returning the same key. 


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

Received on Thursday, 8 August 2019 14:45:24 UTC