BLECombineKit icon indicating copy to clipboard operation
BLECombineKit copied to clipboard

centralManager.scanForPeripherals call as hot publisher

Open adriansergheev opened this issue 4 years ago • 0 comments

Hi, centralManager.scanForPeripherals(withServices:, options:) which returns AnyPublisher<BLEScanResult, BLEError> acts as a hot observable since it executes original Apple provided scanForPeripherals(withServices:, options:) under the hood, which is a side effect.

Alternatively, that call can be postponed until the Bluetooth library receives .poweredOn state or something like that, or wrap it in a Deferred etc.

Using 0.1.6 version.

adriansergheev avatar Sep 29 '21 09:09 adriansergheev