RobotPajamas / SwiftyTeeth

A simple, lightweight library intended to take away some of the cruft and tediousness of using CoreBluetooth
Apache License 2.0
23 stars 8 forks source link

Investigate implicit disconnections when using reactive API #39

Open sureshjoshi opened 4 years ago

sureshjoshi commented 4 years ago

Instead of having a scan/stopScan - maybe just scan and automatic stop on dispose.

Ditto for connection/disconnection.

Not sure if this would make for a better or worse API. Explicit is nice, but it's also awkward in a Reactive context because should the stopScan return a Completable? Observable? etc..

Same with Connectables...

Should connection state be monitored using a connectivity() -> Observable api, or should connection state be based on the act of connection, or both? The former is more usable, while expanding the API surface, the second has the "fault" that an explicit connection is always required to even find out the connectivity state.