src/events/ReconnectingWebSocket.js
/**
   * Websocket 'close' handler that attempts to reconnect if reconnect is
   * enabled. Otherwise, it only feeds the 'close' event back up the chain.
   *
   * @private
   */
Websocket 'close' handler that attempts to reconnect if reconnect is
enabled. Otherwise, it only feeds the 'close' event back up the chain.

@private
Websocket ' close ' handler that attempts to reconnect if reconnect is enabled . Otherwise it only feeds the ' close ' event back up the chain . @private
handleClose(code, message) {
    debug("connection closed", code, message);
    if (!this._reconnect) {
      this.close();
      return;
    }
    this.emit("disconnected", { reason: "close", code, message });
    debug("attempting to reconnect");
    this.connect((err) => {
      if (err) {
        this.emit("error", err);
        this.close();
        return;
      }
      this.emit("reconnected");
    });
  }
handleClose ( code , message ) { debug ( "connection closed" , code , message ) ; if ( ! this . _reconnect ) { this . close ( ) ; return ; } this . emit ( "disconnected" , { reason : "close" , code , message } ) ; debug ( "attempting to reconnect" ) ; this . connect ( ( err ) => { if ( err ) { this . emit ( "error" , err ) ; this . close ( ) ; return ; } this . emit ( "reconnected" ) ; } ) ; }
Websocket 'close' handler that attempts to reconnect if reconnect is
 enabled.
Websocket ' close ' handler that attempts to reconnect if reconnect is enabled .