How to use @swim/client - 1 common examples

To help you get started, we’ve selected a few @swim/client 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 swimos / swim / swim-system-js / swim-mesh-js / @swim / cli / main / index.ts View on Github external
function link(hostUri: AnyUri | null | undefined, nodeUri: AnyUri | null | undefined,
              laneUri: AnyUri | null | undefined, format?: string | null): client.Downlink {
  return client.downlink()
      .hostUri(hostUri)
      .nodeUri(nodeUri)
      .laneUri(laneUri)
      .keepSynced(true)
      .onEvent((body: Value) => {
        if (format === "json") {
          console.log(JSON.stringify(body.toAny()));
        } else {
          console.log(Recon.toString(body));
        }
      })
      .didUnlink((downlink: client.Downlink) => {
        downlink.close();
      });
}

@swim/client

Streaming API client for linking to lanes of stateful Web Agents using the WARP protocol, enabling massively real-time applications that continuously synchronize all shared states with ping latency

Apache-2.0
Latest version published 3 years ago

Package Health Score

58 / 100
Full package analysis

Popular @swim/client functions