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

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

From: Marcos Cáceres via GitHub <sysbot+gh@w3.org>
Date: Thu, 08 Aug 2019 14:45:22 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-519549840-1565275521-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.3.1 : Thursday, 8 August 2019 14:45:25 UTC