code: function () {
      /** @type {SocketPeer} WebRTC/WebSocket connection. */
      this.peer = null;
  
      /** @type {Overlay} Overlay to display pair code. */
      this.overlay = null;
  
      /** @type {Object} State tracking, keyed by event type. */
      this.state = {};
  
      if (this.data.pairCode) {
        this.setupConnection(this.data.pairCode);
      } else {
        fetch(this.data.proxyUrl + '/ajax/pair-code')
          .then(function (response) { return response.json(); })
          .then(function (data) { return data.pairCode; })
          .then(this.setupConnection.bind(this))
          .catch(console.error.bind(console));
      }
    }
docs: *****************************************************************
  Initialization
   
  Called once when component is attached. Generally for initial setup.