7

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.

1 Answer 1

3

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.