[web-nfc] Remove NDEFPushOptions timeout (#418)

beaufortfrancois has just created a new issue for https://github.com/w3c/web-nfc:

== Remove NDEFPushOptions timeout ==
The NDEFPushOptions `timeout` seems like it could be replaced with a simple timeout and NDEFPushOptions `signal` as you can see below.

Maybe there's more to it, but if not, shall we simply remove it?

```js
const writer = new NDEFWriter();

writer.push('hello world', { timeout: 5000 });
.catch(e => {
  if (e.name === 'TimeoutError') {
    // Push operation timed out.
  }
});
```
and its equivalent
```js
const writer = new NDEFWriter();
const controller = new AbortController();

setTimeout(() => controller.abort(), 5000);

writer.push('hello world', { signal: controller.signal });
.catch(e => {
  if (e.name === 'AbortError') {
    // Push operation has been aborted.
  }
});
```

Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/418 using your GitHub account

Received on Monday, 28 October 2019 09:52:17 UTC