How to use the @nteract/messaging.withCommId function in @nteract/messaging

To help you get started, we’ve selected a few @nteract/messaging examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nteract / nteract / packages / jupyter-widgets / src / manager / widget-comms.ts View on Github external
on_close(callback: (x: any) => void): void {
    this.kernel.channels
      .pipe(
        ofMessageType("comm_close"),
        withCommId(this.comm_id)
      )
      .subscribe((msg: any) => {
        callback(msg);
      });
  }
github nteract / nteract / packages / jupyter-widgets / src / manager / widget-comms.ts View on Github external
on_msg(callback: (x: any) => void): void {
    this.kernel.channels
      .pipe(
        ofMessageType("comm_msg"),
        withCommId(this.comm_id)
      )
      .subscribe((msg: any) => {
        callback(msg);
      });
  }