orbital-systems / react-native-esp-idf-provisioning

ESP IDF provisioning and custom data library for react-native
MIT License
26 stars 6 forks source link

Use factory pattern for ESPDevice making calls to connect cleaner #27

Open mateogianolio opened 10 months ago

mateogianolio commented 10 months ago

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