Published
Edited
Jan 12, 2022
7 stars
Insert cell
Insert cell
debounce = require("debounce@1.2.1").catch(() => window.debounce)
Insert cell
mutable hello = null
Insert cell
bouncer = debounce((u) => callback(u), 500, false)
Insert cell
callback = (u) => (mutable hello = u)
Insert cell
{
do {
const wait = (1000 * Math.random()) | 0;
bouncer(wait);
await Promises.delay(wait);
yield ""; // necessary to break the loop when this cell is invalidated
} while (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