manolofdez / AsyncBluetooth

A small library that adds concurrency to CoreBluetooth APIs.
MIT License
160 stars 30 forks source link

make initialisers public #21

Closed ConfusedVorlon closed 1 year ago

ConfusedVorlon commented 1 year ago

this allows users (me!) to integrate your excellent project without going 'all in'

in my case, I don't want to refactor my work around scanning yet - but once I have my cbperipherals, it's fantastically useful to be able to do async service/characteristic discovery.

as it stands, I can't create a Peripheral from a CBPeripheral.

thanks

ConfusedVorlon commented 1 year ago

To me, that's an issue for documentation.

It's your repo, so you get to choose whether you prioritise idiot-proof-ing, or utility. Personally I favour sharp knives

I'm not the only one in the fork network who has added this kind of change, so not the only one who finds it useful. But I can stick to my private repo if you don't want it.

either way - it's a great set of functionality, and much appreciated.

manolofdez commented 1 year ago

I hear what you're saying. I personally prefer the API to be a little cleaner/safer, with a smaller surface area. But I definitely see the value of having these constructors public. I've also been wanting to add support for testing (maybe replacing the parameters in the constructors with protocols). Having these be public would be the first step towards that goal, so it makes total sense to bring this in. Thanks for sharing!