Options
All
  • Public
  • Public/Protected
  • All
Menu

databench

Index

Modules

Classes

Functions

Functions

attach

  • attach(wsUrl?: undefined | string, requestArgs?: undefined | string, analysisId?: undefined | string): Promise<Connection>
  • Attach to a backend.

    Similar to connect. Instead of a callback parameter, it returns a Promise that resolves to a Connection instance once the connection is established.

    Parameters

    • Optional wsUrl: undefined | string

      URL of WebSocket endpoint or undefined to guess it.

    • Optional requestArgs: undefined | string

      search part of request url or undefined to take from window.location.search.

    • Optional analysisId: undefined | string

      Specify an analysis id or undefined to have one generated. The connection will try to connect to a previously created analysis with that id.

    Returns Promise<Connection>

connect

  • connect(wsUrl?: undefined | string, requestArgs?: undefined | string, analysisId?: undefined | string, callback?: undefined | function): Connection
  • Create a Connection and immediately connect to it.

    This is a shorthand for

    new Connection(wsUrl, requestArgs, analysisId).connect();
    

    Use this function in tests where you know that connect() will not trigger any callbacks that you should listen to. In regular code, it is better to define all on callbacks before calling connect() and so this shorthand should not be used.

    Parameters

    • Optional wsUrl: undefined | string

      URL of WebSocket endpoint or undefined to guess it.

    • Optional requestArgs: undefined | string

      search part of request url or undefined to take from window.location.search.

    • Optional analysisId: undefined | string

      Specify an analysis id or undefined to have one generated. The connection will try to connect to a previously created analysis with that id.

    • Optional callback: undefined | function

      Called when connection is established.

    Returns Connection

Generated using TypeDoc