Published
Edited
Apr 26, 2019
Insert cell
md`# Counting Function Calls`
Insert cell
mutable count = 0
Insert cell
a = 1
Insert cell
b = 2
Insert cell
foo = {
a; // Dependency
b; // Dependency

invalidation.then(() => {
mutable count = 0;
});

return function foo() {
mutable count += 1;
// do some work...
return "ok";
};
}
Insert cell
{
while (true) {
await Promises.delay(1000);
yield foo();
}
}
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