How to use @swim/recon - 3 common examples

To help you get started, we’ve selected a few @swim/recon 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
.onEvent((body: Value) => {
        if (format === "json") {
          console.log(JSON.stringify(body.toAny()));
        } else {
          console.log(Recon.toString(body));
        }
      })
      .didUnlink((downlink: client.Downlink) => {
github swimos / ripple / ui / main / SwimMirrorViewController.ts View on Github external
protected onRemoteRemoveCharge(key: Value): void {
    const view = this.view!;
    if (key.getItem(0).equals(view.id)) {
      return;
    }
    const id = Recon.toString(key);
    view.setChildView(id, null);
  }
github swimos / ripple / ui / main / SwimMirrorViewController.ts View on Github external
protected onRemoteUpdateCharge(key: Value, value: Value): void {
    const view = this.view!;
    if (key.getItem(0).equals(view.id)) {
      return;
    }
    const id = Recon.toString(key);
    const t0 = value.get("t0").numberValue(Date.now());
    const centerX = value.get("x").numberValue(Math.random());
    const centerY = value.get("y").numberValue(Math.random());
    const chargeRadius = value.get("r").numberValue(0);
    if (!chargeRadius) {
      return;
    }
    const color = value.get("color").stringValue("#00a6ed");
    const tween = Transition.duration(300);
    let charge = view.getChildView(id) as ChargeView | null;
    if (charge) {
      charge.t0 = t0;
      charge.centerX.setState(centerX);
      charge.centerY.setState(centerY);
      charge.chargeColor(color, tween)
            .chargeRadius(chargeRadius, tween)

@swim/recon

Object notation with attributes, like if JSON and XML had a baby

Apache-2.0
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular @swim/recon functions