How to use the nbdime/lib/request.requestApiJson function in nbdime

To help you get started, we’ve selected a few nbdime 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 jupyter / nbdime / packages / labextension / src / widget.ts View on Github external
Private.toggleShowUnchanged(this.scroller, !hideUnchangedChk.checked);
    };
    if (options.hideUnchanged) {
      Private.toggleShowUnchanged(this.scroller, false);
    }

    let args: JSONObject;
    if (this.remote) {
      args = {base: this.base, remote: this.remote};
    } else if (options.baseLabel === 'Checkpoint') {
      args = {base: `checkpoint:${this.base}`}
    } else {
      args = {base: `git:${this.base}`}
    }

    requestApiJson(
      ServerConnection.defaultSettings.baseUrl,
      'nbdime/api/diff',
      args,
      this.onData.bind(this),
      this.onError.bind(this));
    this.id = `nbdime-${JSON.stringify(args)}`;
    this.title.closable = true;
    return this;
  }