In the "real" Web Serial API it is possible to add and remove Event listener that listen on the connect and disconnect events: ```javascript serial.addEventListener('connect', connectHandler); serial.addEventListener('disconnect', disconnectHandler); ``` The disconnect listener is IMHO especially important, so that one can clean up after the device has been disconnected.
In the "real" Web Serial API it is possible to add and remove Event listener that listen on the connect and disconnect events:
The disconnect listener is IMHO especially important, so that one can clean up after the device has been disconnected.