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

I think in general APIs are migrating away from explicitly passing callbacks in favor of either Promises for one-shot events or event listeners for repeating events. I like the idea of creating an `NFCWatch` (or `NFCReadFilter`) and adding an event listener to that. Unless it is absolutely necessary a `startNotifications()` method could be overkill. It is useful for Web Bluetooth because turning on notifications requires communicating with the device and so can fail in more interesting ways. `addEventListener()`/`removeEventListener()` could be sufficient for turning on and off notifications.

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

Received on Thursday, 27 September 2018 17:38:30 UTC