react-native-esp-idf-provisioning
react-native-esp-idf-provisioning copied to clipboard
Use factory pattern for ESPDevice making calls to connect cleaner
If we rewrite ESPDevice to a factory class returning subclasses based on input params for transport
and security
, we can get cleaner method calls to connect
(instead of passing null
for unused params):
// security 0, ble
device.connect();
// security 0, softAP
device.connect(softAPPassword);
// ... etc