Closed stefaneidelloth closed 3 years ago
I’m not sure I fully understand what you’re trying to do here, but I think the short answer is that observers don’t do that; you can only observe the computation status (whether a variable is pending or not) and when it fulfills or rejects. You can’t observe the definition of the variable itself.
I experiment with a custom observer that allows to edit cells and currently I access the cell body in a very hackish way, see below.
=> What is the recommended way to access the cell definition in a custom observer?
I suggest that you pass the cell inputs and definition to the observer instead of only passing the result value, e.g.:
instead of
in
https://github.com/observablehq/runtime/blob/34a5c820ac166b08463f10a69ca43b64e836527d/src/variable.js
Screenshot:
Draft for custom Editor, based on default Inspector, accessing cell bodies based on ugly workaround:
Usage example:
Exported observablehq notebook: