Published
Edited
Apr 20, 2022
Insert cell
Insert cell
htmlList = {
// Forces update to be executed first. Try commenting the following line and re-executing

return html`
<h2>Current state</h2>
${viewof newItem}
<ul>
${listOfItems.map((i) => `<li>${i}</li>`)}
</ul>`;
}
Insert cell
Insert cell
listOfItems = {
const listOfItems = this || [];

if (newItem) {
listOfItems.push(newItem);
}
return listOfItems;
}
Insert cell
Insert cell
viewof newItem = Inputs.text({ label: "Add a new item:", submit: true })
Insert cell

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.
Learn more