Platform
Resources
Pricing
Sign in
Get started
John Alexis Guerra Gómez
I love to build dataviz for insight discovery. I also love to put technology to the service of humanity
Workspace
Fork
Published
Notebook Based Reactive Programming
By
John Alexis Guerra Gómez
Edited
Apr 20, 2022
2 forks
1
Insert cell
Insert cell
htmlList
=
{
// Forces update to be executed first. Try commenting the following line and re-executing
update
;
return
html
`
<h2>Current state</h2>
${
viewof
newItem
}
<ul>
${
listOfItems
.
map
(
(
i
)
=>
`<li>${
i
}</li>`
)
}
</ul>`
;
}
Insert cell
Insert cell
listOfItems
=
[
]
Insert cell
Insert cell
viewof
newItem
=
Inputs
.
text
(
{
label
:
"Add a new item:"
,
submit
:
true
}
)
Insert cell
Insert cell
update
=
{
// only add a new item if it has value
if
(
newItem
)
listOfItems
.
push
(
newItem
)
;
}
Insert cell
Insert cell
id
=
"@john-guerra/forcing-execution-order"
Insert cell
import
{
chart
}
with
{
id
}
from
"@observablehq/notebook-visualizer"
Insert cell
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
htmlList
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
listOfItems
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
newItem
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
update
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
id
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML