How to use the @nteract/epics/lib/comm.createCommMessage function in @nteract/epics

To help you get started, we’ve selected a few @nteract/epics 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
send(
    data: any,
    callbacks: any,
    metadata?: any,
    buffers?: ArrayBuffer[] | ArrayBufferView[]
  ): string {
    const message = createCommMessage(
      this.comm_id,
      data,
      this.flattenBufferArrays(buffers)
    );

    const callbackAction$ = this.kernel.channels.pipe(
      childOf(message),
      outputs() as any,
      map((output: any) => this.actions.appendOutput(output))
    );

    Observable.create((observer: Observer) => {
      const subscription = callbackAction$.subscribe(observer);
      this.kernel.channels.next(message);
      return subscription;
    }).subscribe(console.log, console.error, console.log);

@nteract/epics

Redux-Observable epics for nteract apps

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

63 / 100
Full package analysis