onDeviceAdded property

EventStream<Device> get onDeviceAdded

Event generated when a device is added to the system. Events are only broadcast to apps and extensions that have permission to access the device. Permission may have been granted at install time, when the user accepted an optional permission (see permissions.request), or through getUserSelectedDevices.

Implementation

EventStream<Device> get onDeviceAdded =>
    $js.chrome.usb.onDeviceAdded.asStream(($c) => ($js.Device device) {
          return $c(Device.fromJS(device));
        }.toJS);