Skip to content

Granular DOM updates when array is modified #344

Answered by ryansolid
quixot1c asked this question in Q&A
Discussion options

You must be logged in to vote

They aren't handled differently. It's one of the reasons to use state vs signals. There is only shallow diffing anywhere in the DOM handling side of things. For simple changes on nodes we are talking primitive values, strings numbers etc.. So there isn't really much concern here on updates here. But for nested values it gets trickier. If you use a signal to hold an array of objects and only want to update one property on it, well you are going to do wasted work. You are going to blow out the whole row. State is better here.

If you are talking about an array of strings though, it doesn't really matter which way you go. And in the term of list handling you probably want to use <Index> to ke…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@quixot1c
Comment options

@ryansolid
Comment options

Answer selected by quixot1c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants