index.js
function emitData() {
      for(var i=0;i<streamQueue.length;i++) {
        var dataQueue = streamQueue[i].dataQueue;

        if(streamQueue[i].pending) {
          return;
        }

        for(var j=0;j<dataQueue.length;j++) {
          var data = dataQueue[j];
          if(!!data) {
            _this.emit('data', data);
            dataQueue[j] = null;

            return emitData();
          }
        }
      }

      if(currentStream === streamQueue.length) {
        _this.emit('end');
      }
    }
function emitData() {
      for(var i=0;i<streamQueue.length;i++) {
        var dataQueue = streamQueue[i].dataQueue;

        if(streamQueue[i].pending) {
          return;
        }

        for(var j=0;j<dataQueue.length;j++) {
          var data = dataQueue[j];
          if(!!data) {
            _this.emit('data', data);
            dataQueue[j] = null;

            return emitData();
          }
        }
      }

      if(currentStream === streamQueue.length) {
        _this.emit('end');
      }
    }
function emitData ( ) { for ( var i = 0 ; i < streamQueue . length ; i ++ ) { var dataQueue = streamQueue [ i ] . dataQueue ; if ( streamQueue [ i ] . pending ) { return ; } for ( var j = 0 ; j < dataQueue . length ; j ++ ) { var data = dataQueue [ j ] ; if ( ! ! data ) { _this . emit ( 'data' , data ) ; dataQueue [ j ] = null ; return emitData ( ) ; } } } if ( currentStream === streamQueue . length ) { _this . emit ( 'end' ) ; } }
Emit everything available so far in the queue
Emit everything available so far in the queue