// Forces update to be executed first. Try commenting the following line and re-executing
returnhtml`
<h2>Current state</h2>
${viewofnewItem}
<ul>
${listOfItems.map((i)=>`<li>${i}</li>`)}
</ul>`;
}
listOfItems={
constlistOfItems=this||[];
if(newItem){
listOfItems.push(newItem);
}
returnlistOfItems;
}
viewofnewItem=Inputs.text({label:"Add a new item:",submit:true})
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.