Options
All
  • Public
  • Public/Protected
  • All
Menu

Package rx-binder

rx-binder

This package provides a set of functions for connecting to a remote instance provided by Binder. This package will allow you to connect to a remote compute instance from your nteract application to execute code. To see this package in action, you can view the source code for the nteract play app.

Installation

$ yarn add rx-binder
$ npm install --save rx-binder

Usage

const { binder } = require("rx-binder");

binder({ repo: "nteract/vdom" }).subscribe(msg => console.log(msg)); > { phase: 'built', imageName: 'gcr.io/binder-prod/prod-v4-1-nteract-vdom:78fa2b549f67afc3525543b0bccfb08a9e06b006', message: 'Found built image, launching...\n' } { phase: 'launching', message: 'Launching server...\n' } { phase: 'ready', message: 'server running at https://hub.mybinder.org/user/nteract-vdom-r115e00y/\n', url: 'https://hub.mybinder.org/user/nteract-vdom-r115e00y/', token: 'tocwpFakeToken' }

Documentation

You can view the reference documentation for rx-binder in the package docs.

Support

If you experience an issue while using this package or have a feature request, please file an issue on the issue board and add the pkg:rx-binder label.

License

BSD-3-Clause

Index

Type aliases

IEventSourceConstructor

IEventSourceConstructor: object

Type declaration

Variables

Const defaultEventSource

defaultEventSource: IEventSourceConstructor = typeof window !== "undefined" &&"EventSource" in (window as any) &&(window as any).EventSource

Const mybinderURL

mybinderURL: "https://mybinder.org" = "https://mybinder.org"

Functions

Const binder

  • binder(options: BinderOptions, EventSourceDI?: object): Observable<any>
  • Returns an observable stream for mybinder.org or any related

    Parameters

    • options: BinderOptions

      repo and other options to connect

    • Default value EventSourceDI: object = defaultEventSource

      allows overriding EventSource for testing

    Returns Observable<any>

    An Observable with a connection to a Binder instance

Const cleanRepo

  • cleanRepo(repo: string): string
  • Strips the github.com URL base from a repo URL.

    Parameters

    • repo: string

      A complete repo URL

    Returns string

    The repo without github.com

Const formBinderURL

  • formBinderURL(__namedParameters?: object): string
  • Returns a URL for initializing a connection to Binder.

    Parameters

    • Default value __namedParameters: object = {}
      • binderURL: string
      • ref: string
      • repo: string

    Returns string

    A Binder URL

Generated using TypeDoc