How to use the @swim/structure.Form.forNumber function in @swim/structure

To help you get started, we’ve selected a few @swim/structure 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 / client / main / downlink / DownlinkStreamlet.ts View on Github external
protected onReconcile(version: number): void {
    const hostUri = this.castInput(this.hostUri, Form.forString());
    const nodeUri = this.castInput(this.nodeUri, Form.forString());
    const laneUri = this.castInput(this.laneUri, Form.forString());
    const prio = this.castInput(this.prio, Form.forNumber(), 0);
    const rate = this.castInput(this.rate, Form.forNumber(), 0);
    const body = this.getInput(this.bodyValue);
    const type = this.castInput(this.type, Form.forString(), void 0) as DownlinkType | undefined;
    if (hostUri !== this.inputHostUri || nodeUri !== this.inputNodeUri || laneUri !== this.inputLaneUri
        || prio !== this.inputPrio || rate !== this.inputRate
        || (body === void 0 ? this.inputBody !== void 0 : !body.equals(this.inputBody))
        || type !== this.inputType) {
      if (this.downlink) {
        this.downlink.close();
        this.downlink = void 0;
        this.downlinkRecord = void 0;
      }
      this.inputHostUri = hostUri;
      this.inputNodeUri = nodeUri;
      this.inputLaneUri = laneUri;
      this.inputPrio = prio;