You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example 2.b) generates the following error message when copied to the Angular project:
Argument of type 'OperatorFunction<BluetoothRemoteGATTService, void | BluetoothRemoteGATTCharacteristic>' is not assignable to parameter of type 'OperatorFunction<BluetoothRemoteGATTService, BluetoothRemoteGATTCharacteristic>'.
Type 'void | BluetoothRemoteGATTCharacteristic' is not assignable to type 'BluetoothRemoteGATTCharacteristic'.
Type 'void' is not assignable to type 'BluetoothRemoteGATTCharacteristic'.
The text was updated successfully, but these errors were encountered:
There are several bugs in the library. The Promise.reject(...) parts in bluetooth.service.ts line 162, 255 and 264 must be returned. In the else branch of line 165 a Promise.reject(...) must also be returned. I use the following hot fix:
private readonly fixMap = <T>(t: T | void) => {
if (!t) {
throw new Error();
}
return t;
};
private readonly device$ = this.bluetooth
.discover$({
optionalServices: [this.serviceUuid],
filters: [{ services: [this.globalServiceUuid] }],
})
.pipe(
// Hot fix for bug in bluetooth core
map(this.fixMap),
mergeMap(server =>
this.bluetooth.getPrimaryService$(server, this.serviceUuid)
),
mergeMap(service =>
this.bluetooth.getCharacteristic$(service, this.characteristicUuid)
),
// Hot fix for bug in bluetooth core
map(this.fixMap)
);
@manekinekko you should enable strict mode to avoid such mistakes. Best greetings :)
Example 2.b) generates the following error message when copied to the Angular project:
The text was updated successfully, but these errors were encountered: