Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@deephaven/jsapi-bootstrap

Package Overview
Dependencies
Maintainers
6
Versions
516
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deephaven/jsapi-bootstrap

Deephaven JSAPI Bootstrap

  • 0.32.1-beta.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8K
decreased by-1.44%
Maintainers
6
Weekly downloads
 
Created
Source

@deephaven/jsapi-bootstrap

This is a library to bootstrap load the JS API. It provides functionality to load the API and set it in a context object, or to set it globally to retain legacy behaviour. Will display an error if unable to load the API.

Install

npm install --save @deephaven/jsapi-bootstrap

Usage

Using Context

import { ApiBootstrap, useApi } from '@deephaven/jsapi-bootstrap';

function MyComponent() {
  const api = useApi();

  ...
}

<ApiBootstrap apiUrl={API_URL}>
  <MyComponent />
</ApiBootstrap>;

Using API globally (legacy behaviour)

If you're using the JSAPI shim or relying on the API to be set globally, you'll need to lazily load your component first so the API is set before imports attempt to use it.

// App.tsx
import { ApiBootstrap } from '@deephaven/jsapi-bootstrap';

const MyComponent = React.lazy(() => import('./MyComponent'));

<ApiBootstrap apiUrl={API_URL} setGlobally>
    <Suspense fallback={<div>Loading...</div>}>
      <MyComponent />
    </Suspense>
</ApiBootstrap>;

// MyComponent.tsx
import dh from '@deephaven/jsapi-shim';
function MyComponent() {
  const client = new dh.CoreClient(...);

  ...
}

FAQs

Package last updated on 11 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc