react-native-esp-idf-provisioning icon indicating copy to clipboard operation
react-native-esp-idf-provisioning copied to clipboard

Use factory pattern for ESPDevice making calls to connect cleaner

Open mateogianolio opened this issue 1 year ago • 0 comments

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

mateogianolio avatar Dec 21 '23 12:12 mateogianolio