Published unlisted
Edited
Nov 16, 2020
Insert cell
md`# Can we do memoization?

Question asked here:
`
Insert cell
miliseconds = now
Insert cell
startTime = {
return Date.now();
}
Insert cell
elapsedSeconds = Math.floor((miliseconds - startTime) / 1000)
Insert cell
note = {
// Is there a canonical way to only update the DOM if ellapsedSeconds has actually changed?
return md`Seconds elapsed since load: ${elapsedSeconds}`;
}
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