diff --git a/README.md b/README.md index e1a079d..88cca3d 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,9 @@ import { createBridge } from 'jupyter-iframe-commands-host'; // Initialize the bridge with your iframe ID const commandBridge = createBridge({ iframeId: 'your-jupyter-iframe-id' }); +// Wait for the bridge to be ready before executing commands +await commandBridge.ready; + // Execute JupyterLab commands // Example: Toggle the left sidebar await commandBridge.execute('application:toggle-left-area'); @@ -139,6 +142,9 @@ import { createBridge, createProxy } from 'jupyter-iframe-commands-host'; const commandBridge = createBridge({ iframeId: 'jupyterlab' }); +// Wait for the bridge to be ready +await commandBridge.ready; + const kernelStatus = async ({ displayName, isBusy }) => { console.log('Received kernel status update from the iframe'); console.log('Display Name:', displayName);