Closed theengineear closed 1 year ago
I’m on the fence for this one. At a minimum, I’d like to start without support for the ?
sugar. One of the main goals of x-element
is to stay minimal — this functionality is strictly not necessary.
Additionally, I think that using boolean
is more favorable since it exposes users to what’s really going on and will better-prepare them for leveraging things like defining a custom updater
later.
@klebba — Based on our conversation, we've decided to go with the ?
syntax and not expose the a boolean
updater.
Authors can already leverage a
boolean
updater to accomplish a boolean attribute binding. Adding syntactic sugar may potentially be a more ergonomic solution.Why we might add it:
Why we might not add it:
Proposal
Users would be able to declare something like the following to bind an attribute as a boolean (see the
?
in there?):Currently
…for comparison, this is how you would do this currently.
Note that the what to do (i.e., bind an attribute) is nicely separated from the how to do it (i.e., in a boolean fashion).