Closed urish closed 7 years ago
sketch for a possible implementation:
notifications$(char: BluetoothRemoteGATTCharacteristic) { char.startNotifications(); const disconnected = Observable.fromEvent(char.service.device as any, 'gattserverdisconnected'); return Observable.fromEvent(char as any, 'characteristicvaluechanged').takeUntil(disconnected).map(event => event.target.value as DataView); }
You'd still need to stop the notifications when everybody unsubscribes, but I guess this can be added later.
sketch for a possible implementation:
You'd still need to stop the notifications when everybody unsubscribes, but I guess this can be added later.