Open mattrei opened 6 years ago
Can you make more fine-grained operations based on the state? e.g., rather than re-rendering an entire group of entities, do only the things you need. Such as changing component properties. If there is a case where you do need to change an entire group of entities, you can make a component on a parent entity that manages the children, and does stuff when state changes.
One thing I have is a render-entities
component, and I bind dirtyIds
from state to that component. And when dirtyIds
change, render-entities
will create/remove/update entities. My application though only has one instance where I need to do these types of things, so it works for me.
I understand. So each child of the node gets its unique DOM id and you manage those within an array. I like that approach and I will follow it.
Anyway, would you propose the change in the template component, that means rerender the template when the data changes? Or might it inflict too much on the performance?
Hi,
currently I am trying to use the template component with the state component to dynamically update the rendered template when a data- attribute changes. The data changes however the template does not get rerendered.
Is this a good use case for using templates or should I switch to React? Because I am having quite some UI state that needs to be drawn dynamically. I wanted to overcome React with the beautiful state and template component... However it seem to be though to handle this issue.
Best