How to use @nteract/epics - 2 common examples

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);
github nteract / nteract / packages / jupyter-widgets / src / manager / widget-comms.ts View on Github external
open(
    data: any,
    callbacks: any,
    metadata?: any,
    buffers?: ArrayBuffer[] | ArrayBufferView[]
  ): string {
    const message = createCommOpenMessage(
      this.comm_id,
      this.target_name,
      this.flattenBufferArrays(buffers),
      this.target_module
    );
    this.kernel.channels.next(message);
    return message.header.msg_id;
  }

@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