parser
parser copied to clipboard
Promise for cell operator (promiseof)
It’d be nice if there were a way to opt-in to getting a promise of a cell’s next value. This would allow two things:
-
A cell could start running before a cell it references has fulfilled. This would allow some operations to proceed in parallel, without needing to break these operations out into another cell.
-
A cell could handle an error if a cell it references errors. For example,
promiseof foo.catch(() => "default")
ortry { return await promiseof foo; } catch { return "default"; }
. Related https://github.com/observablehq/runtime/issues/286.
this would be really powerful for sql cells where its going to be expected that queries may run for a while but still want to indicate to consumer of notebook that the results of the query are being waited on