mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
feat(jupyter): send Jupyter messaging metadata with Deno.jupyter.broadcast
(#20714)
Exposes [`metadata`](https://jupyter-client.readthedocs.io/en/latest/messaging.html#metadata) to the `Deno.jupyter.broadcast` API. ```js await Deno.jupyter.broadcast(msgType, content, metadata); ``` The metadata is required for [`"comm_open"`](https://github.com/jupyter-widgets/ipywidgets/blob/main/packages/schema/messages.md#instantiating-a-widget-object-1) for with `jupyter.widget` target.
This commit is contained in:
parent
2d1af0cf51
commit
7bcf1211a1
4 changed files with 15 additions and 2 deletions
|
@ -9,8 +9,8 @@ function enableJupyter() {
|
|||
} = core.ensureFastOps();
|
||||
|
||||
globalThis.Deno.jupyter = {
|
||||
async broadcast(msgType, content) {
|
||||
await op_jupyter_broadcast(msgType, content);
|
||||
async broadcast(msgType, content, { metadata = {} } = {}) {
|
||||
await op_jupyter_broadcast(msgType, content, metadata);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue