How to use the rx-jupyter.bookstore.publish function in rx-jupyter

To help you get started, we’ve selected a few rx-jupyter 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 / epics / src / hosts.ts View on Github external
switchMap(action => {
      const targetPath: string = action.payload.model.path;
      const model: any = action.payload.model;

      // Publish notebook to Bookstore
      return bookstore.publish(serverConfig, targetPath, model).pipe(
        tap((xhr: AjaxResponse) => {
          if (xhr.status !== 200) {
            throw new Error(xhr.response);
          }
          console.log("XHR: ", xhr);
        }),
        map(() => {
          actions.publishToBookstoreSucceeded({
            contentRef: action.payload.contentRef
          });
        }),
        catchError((xhrError: any) =>
          of(
            actions.publishToBookstoreFailed({
              error: xhrError,
              contentRef: action.payload.contentRef