Closed dtex closed 4 years ago
It's either an array or not an array. If it's not an array, we need to normalize it to an array and then call normalizeParams on each member of the array.
Here's another pattern... If there are device params we could have:
const rgb = new RGB({
pins: [12, 13, 14],
io: PWM,
sink: true
});
or worse, device params along with multiple providers:
const rgb = new RGB({
pins: [12, { pin: 13, io: ExpanderPWM }, 14],
sink: true
});
Signature for devices that require more than one IO are kind of a mess. Take RGB for example. If you're just passing pin numbers and using the default IO (builtin/pwm) it could be:
But if you need usa a specific IO it could be:
But what if you want to use multiple IO providers? That would have to be:
or
I need to make sure all of these cases are addressed. Any others?