parser icon indicating copy to clipboard operation
parser copied to clipboard

Promise for cell operator (promiseof)

Open mbostock opened this issue 3 years ago • 1 comments

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:

  1. 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.

  2. A cell could handle an error if a cell it references errors. For example, promiseof foo.catch(() => "default") or try { return await promiseof foo; } catch { return "default"; }. Related https://github.com/observablehq/runtime/issues/286.

mbostock avatar Jun 15 '21 02:06 mbostock

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

enjalot avatar May 20 '22 16:05 enjalot