Re: [screen-wake-lock] editorial: Tidy up uses of "in parallel". (#299)

> Is there any particular reason for using "global" here?

Yes, it helps ensure the task is queued on the correct event loop and all the relevant bits are set correctly. (Though @domenic has been suggesting that we have some kind of ambient global available for constructing objects we could also repurpose here perhaps...)

> Would it be OK (from an idiomatic perspective) to remove the check altogether and sort of under-specify the behavior by leaving it up to each implementation to determine whether to ask the platform for a lock?

Maybe, not sure. It seems easy enough to add some boolean that you can use to prevent this, no?

> If it's basically "fire events away and only queue a task to fire them if necessary", then I'm fine with the changes being done here.

It depends on the cause and the target, I think here it's fine. If it was in response to a DOM mutation I'd ask for a change.

-- 
GitHub Notification of comment by annevk
Please view or discuss this issue at https://github.com/w3c/screen-wake-lock/pull/299#issuecomment-777600796 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 11 February 2021 16:00:08 UTC