When I’m writing a component, it is up to the user of the component whether they wrap an attribute in the mut
helper. It would seem that, if I want to support non-immutable components, I need to check if the component is wrapped in mut
.
Is this correct? And if so, what is the best way to check for mut
? Just attr.foo.value || attr.foo
doesn’t seem very robust.
The new paradigm seems a bit strange to me – that the user not the component author decides what is mutable and what is not. If someone could comment on why its designed this way I’d be grateful.
(I guess the answer is partly because “data-down” means its up to the invoker to decide whether to accept anything coming back up. But it seems odd that the “internal interface” inside the component isn’t more robust. Just because I’m not allowed to push data back up doesn’t mean I can’t be allowed not to accept data coming back down, or that I should even care whether or not data is actually being propagated back up.)