What is "invalidation" in this Observablehq example?
Asked Answered
I

1

8

https://observablehq.com/@d3/force-directed-lattice?collection=@d3/d3-drag

there is a line

invalidation.then(() => simulation.stop());

what is this invalidation? by the console.log, it is a promise, but I don't see it defined anywhere.

Indulgence answered 16/3, 2021 at 13:59 Comment(0)
V
4

Observablehq loads the standard library, which provides the invalidation method. According to the documentation, invalidation is...

A promise that resolves when the current cell is re-evaluated: when the cell’s code changes, when it is run using Shift-Enter, or when a referenced input changes.

This notebook explains it in details: https://observablehq.com/@observablehq/invalidation

V1 answered 16/3, 2021 at 22:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.