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

I agree that the API is potentially confusing. The Promise returned by `WakeLock.request()` never resolves. It only rejects when the wake lock has been released. This is the result of an extensive conversation that resulted in #201.

The intuition is that the "lock acquired" state is uninteresting. If we fail to acquire a wake lock it will happen quickly and the Promise will be rejected. If we successfully acquire a lock the site only cares if that lock is taken away from it.

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

Received on Wednesday, 7 August 2019 16:33:21 UTC