[wake-lock] New API with AbortController is not intuitive for developers. (#214)

mrunalk has just created a new issue for https://github.com/w3c/wake-lock:

== New API with AbortController is not intuitive for developers. ==
Looking at the examples let's say the first one,
```
  const controller = new AbortController();
  const signal = controller.signal;

  WakeLock.request("screen", { signal });

  setTimeout(() => controller.abort(), minutes * 60 * 1000);
```
It seems the whole API is implemented around AbortController. I don't see many API's in Chrome using AbortController yet. If you look at the previous API it seems much more readable and easy to use IMO although I definitely think reliance on Navigator interface and WakeLockRequest should go and request() and cancel() should be the only methods as part of WakeLock interface.

Does anyone else also think the same?

Please view or discuss this issue at https://github.com/w3c/wake-lock/issues/214 using your GitHub account

Received on Thursday, 16 May 2019 18:52:38 UTC