It feels like I'm facing the same thing the same problems writing the API of these components. In particular:
- A component might have several distinct modes. As in, an
<x-gif speed="1.0">
has a very different playback mode from<x-gif bpm="120">
, so you shouldn't be allowed to have bothspeed
andbpm
. But it doesn't seem right to break them into separate components, so either one takes precedence or having both present causes an explosion. - A component might require more than one attribute to be valid. As in,
. Until you have both the `channel` and `note` you can't make connection to the midi signal. But if you're driving the component with a framework like angular, it will first render incompletely (as
), then after a$digest
will insert the right values. So a component may need to permit being in an invalid state temporarily, then when all attributes are set go and get