How to use the @polymer/polymer/lib/utils/debounce.Debouncer.debounce function in @polymer/polymer

To help you get started, we’ve selected a few @polymer/polymer 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 justinribeiro / blog-pwa / app / src / blog-utils-mixin.js View on Github external
xhr.addEventListener('error', function(e) {
      // Flaky connections might fail fetching resources
      if (attempts > 1) {
        this._debounce = Debouncer.debounce(this._debounce,
          timeOut.after(200),
          this._getResource.bind(this, request, attempts - 1));
      } else {
        request.onError.call(this, e);
      }
    }.bind(this));
    xhr.open('GET', request.url);
github home-assistant / home-assistant-polymer / src / panels / config / users / ha-config-users.js View on Github external
_checkRoute(route) {
    // prevent list getting under toolbar
    fireEvent(this, "iron-resize");

    this._debouncer = Debouncer.debounce(
      this._debouncer,
      timeOut.after(0),
      () => {
        if (route.path === "") {
          this.navigate(`${route.prefix}/picker`, true);
        }
      }
    );
  }
github home-assistant / home-assistant-polymer / src / panels / developer-tools / template / developer-tools-template.js View on Github external
templateChanged(ev) {
    this.template = ev.detail.value;
    if (this.error) {
      this.error = false;
    }
    this._debouncer = Debouncer.debounce(
      this._debouncer,
      timeOut.after(500),
      () => {
        this.renderTemplate();
      }
    );
  }
github home-assistant / home-assistant-polymer / src / dialogs / more-info / controls / more-info-climate.js View on Github external
stateObjChanged(newVal, oldVal) {
    if (newVal) {
      this.setProperties({
        awayToggleChecked: newVal.attributes.away_mode === "on",
        auxToggleChecked: newVal.attributes.aux_heat === "on",
        onToggleChecked: newVal.state !== "off",
      });
    }

    if (oldVal) {
      this._debouncer = Debouncer.debounce(
        this._debouncer,
        timeOut.after(500),
        () => {
          this.fire("iron-resize");
        }
      );
    }
  }
github home-assistant / home-assistant-polymer / src / dialogs / more-info / controls / more-info-water_heater.js View on Github external
stateObjChanged(newVal, oldVal) {
    if (newVal) {
      this.setProperties({
        awayToggleChecked: newVal.attributes.away_mode === "on",
      });
    }

    if (oldVal) {
      this._debouncer = Debouncer.debounce(
        this._debouncer,
        timeOut.after(500),
        () => {
          this.fire("iron-resize");
        }
      );
    }
  }
github home-assistant / home-assistant-polymer / src / data / ha-state-history-data.js View on Github external
filterChangedDebouncer(...args) {
    this._debounceFilterChanged = Debouncer.debounce(
      this._debounceFilterChanged,
      timeOut.after(0),
      () => {
        this.filterChanged(...args);
      }
    );
  }
github home-assistant / home-assistant-polymer / src / panels / config / cloud / ha-config-cloud.js View on Github external
_checkRoute(route) {
    this._debouncer = Debouncer.debounce(
      this._debouncer,
      timeOut.after(0),
      () => {
        if (
          !this.cloudStatus ||
          (!this.cloudStatus.logged_in &&
            !NOT_LOGGED_IN_URLS.includes(route.path))
        ) {
          this.navigate("/config/cloud/login", true);
        } else if (
          this.cloudStatus.logged_in &&
          !LOGGED_IN_URLS.includes(route.path)
        ) {
          this.navigate("/config/cloud/account", true);
        }
      }
github home-assistant / home-assistant-polymer / src / components / entity / ha-chart-base.js View on Github external
this._resizeListener = () => {
      this._debouncer = Debouncer.debounce(
        this._debouncer,
        timeOut.after(10),
        () => {
          if (this._isAttached) {
            this.resizeChart();
          }
        }
      );
    };

@polymer/polymer

The Polymer library makes it easy to create your own web components. Give your element some markup and properties, and then use it on a site. Polymer provides features like dynamic templates and data binding to reduce the amount of boilerplate you need to

BSD-3-Clause
Latest version published 3 months ago

Package Health Score

90 / 100
Full package analysis