iconnectivity-js
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -67,3 +67,22 @@ "use strict"; | ||
} | ||
/** | ||
* Waits for the first device(s) to be found and returns them. | ||
* If devices are already found, this returns immediately. | ||
*/ | ||
async waitForDevices() { | ||
if (this.devices.length) { | ||
return this.devices; | ||
} | ||
else { | ||
return new Promise((resolve) => { | ||
const unsubscribe = this.devicesChanged.addListener((devices) => { | ||
if (devices.length) { | ||
unsubscribe(); | ||
resolve(devices); | ||
} | ||
}); | ||
}); | ||
} | ||
} | ||
} | ||
exports.DeviceManager = DeviceManager; |
{ | ||
"name": "iconnectivity-js", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"main": "lib/index.js", | ||
@@ -8,3 +8,4 @@ "license": "MIT", | ||
"test": "jest", | ||
"build": "tsc" | ||
"build": "tsc", | ||
"prepublishOnly": "yarn build" | ||
}, | ||
@@ -11,0 +12,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56465
61
1294