コード例 #1
0
  constructor() {
    super();

    this.breadcrumbStatusRef = null;
    this.primaryBreadcrumbTextRef = null;
    this.lastStatusWidth = 0;

    this.state = {
      shouldRenderServiceStatus: true
    };

    METHODS_TO_BIND.forEach(method => {
      this[method] = this[method].bind(this);
    });

    this.handleViewportResize = Util.debounce(this.handleViewportResize, 100);
  }
コード例 #2
0
ファイル: Actions.js プロジェクト: dcos/dcos-ui
  setRoutes(routes) {
    this.routes = routes;

    if (this.canLog()) {
      this.drainQueue();
    }
  },

  start() {
    this.createdAt = Date.now();
    this.lastLogDate = this.createdAt;
    this.stintID = md5(`session_${this.createdAt}`);

    hashHistory.listen(
      Util.debounce(function(location) {
        Actions.setActivePage(location.pathname + location.search);
      }, 200)
    );

    // Poll to deplete queue
    const checkAnalyticsReady = () => {
      setTimeout(() => {
        if (!this.canLog()) {
          checkAnalyticsReady();
        } else {
          this.drainQueue();
        }
      }, 200);
    };
    checkAnalyticsReady();
  },