Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
open: (id: string): ?Promise<*> => {
if (id.startsWith("webble")) {
const existingDevice = webbleDevices[id];
return existingDevice
? TransportWebBLE.open(existingDevice)
: TransportWebBLE.create();
}
return null;
},
private async getTransport(): Promise {
const device = await this.getDevice();
const transport = await TransportWebBLE.open(device);
transport.on('disconnect', () => {
this.transport = null;
});
return transport;
}
private async getTransport(): Promise {
const device = await this.getDevice();
const transport = await TransportWebBLE.open(device);
transport.on('disconnect', () => {
this.transport = null;
});
return transport;
}