When I inspect the html elements created by the following code (using hyperHTML in Chrome, the entire list refreshes (I am assuming this based on all elements in the <ul>
flashing purple briefly).
function updateList(render, mydata) {
render`
<h1>hi</h1>
<ul>
${mydata.map(x => `<li>${x}</li>`)}
</ul>`;
}
let mylist= new Array(1000).fill(0).map(() => Math.random());
const render = hyperHTML.bind(document.body);
updateList(render, mylist)
setTimeout((render, mylist) => {
mylist[2] = "ww";
updateList(render, mylist);
}, 6000, render, mylist);
Is it actually re-rendering the entire list? If so, how could I improve the performance by only rendering the new change? Is this a valid concern, or am I unneccessarily optimizing?