packages/grpc-native-core/src/client.js
function _emitStatusIfDone() {
  /* jshint validthis: true */
  var status;
  if (this.read_status && this.received_status) {
    if (this.read_status.code !== constants.status.OK) {
      status = this.read_status;
    } else {
      status = this.received_status;
    }
    if (status.code === constants.status.OK) {
      this.push(null);
    } else {
      var error = common.createStatusError(status);
      this.emit('error', error);
    }
    this.emit('status', status);
  }
}
function _emitStatusIfDone() {
  /* jshint validthis: true */
  var status;
  if (this.read_status && this.received_status) {
    if (this.read_status.code !== constants.status.OK) {
      status = this.read_status;
    } else {
      status = this.received_status;
    }
    if (status.code === constants.status.OK) {
      this.push(null);
    } else {
      var error = common.createStatusError(status);
      this.emit('error', error);
    }
    this.emit('status', status);
  }
}
function _emitStatusIfDone ( ) { /* jshint validthis: true */ var status ; if ( this . read_status && this . received_status ) { if ( this . read_status . code !== constants . status . OK ) { status = this . read_status ; } else { status = this . received_status ; } if ( status . code === constants . status . OK ) { this . push ( null ) ; } else { var error = common . createStatusError ( status ) ; this . emit ( 'error' , error ) ; } this . emit ( 'status' , status ) ; } }
If we have both processed all incoming messages and received the status from
the server, emit the status. Otherwise, do nothing.
@private
If we have both processed all incoming messages and received the status from the server emit the status . Otherwise do nothing .