Re: [web-nfc] Use addEventListener instead of watch

> I think it is better extending. 

Maybe so, but what is the general consensus or mechanism on extending standard dictionaries in the platform? Do we need to register those somewhere? (imagine multiple specs adding properties which may clash)

> Creating something that looks similar but has edge cases that works differently isn't really good.

Extending a standard dictionary looks exactly like this. So it's a counter-argument.

> `const filter = navigator.nfc.createReadFilter({`

So we'd need to specify a new NFCFilter interface that contains the `startNotifications()` method? 
Isn't that more complex than just using a `watch()` method?

One way we could do it is define NfcWatchOptions and NfcPushOptions as interfaces (strip the Options from the name), add the `startNotifications()` method, that would return an object that has the `cancel()` method.



-- 
GitHub Notification of comment by zolkis
Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/152#issuecomment-425051138 using your GitHub account

Received on Thursday, 27 September 2018 11:08:47 UTC