Replies: 1 comment 1 reply
-
From what I remember calling custom getValue from the beginning might generate loops in some cases (don't remember which ones though) but I think we could allow this to be controlled with some additional property. Would that solve your use case? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a number of traits that can be applied to a number of components. For some of these traits their values affect other properties of the component, so a kind of computed state. I'd believe this is not a completely uncommon use case.
I'm now thinking about what the best way to encapsulate these traits would be – while the
setValue()
/getValue()
onTraitProperties
seem like ideal candidates the fact that they are not called when the initial value is fetched still forces me to use theinit()
on the component to set the initial values of the computed state properties. I then would need to extend theinit()
for each trait I want to add to a component which feels very convoluted.Am I missing something that would let me fully encapsulate a trait that needs to keep other properties in sync with the current API?
Beta Was this translation helpful? Give feedback.
All reactions