index.js
function join() {
    var pagelet = this
      , result = this._queue.map(function flatten(fragment) {
          if (!fragment.name || !fragment.view) return '';
          return fragment.view;
        });

    try {
      result = this._contentType === contentTypes.json
        ? JSON.stringify(result.shift())
        : result.join('');
    } catch (error) {
      this.emit('done', error);
      return this.debug('Captured error while stringifying JSON data %s', error);
    }

    this._queue.length = 0;
    return result;
  }
function join() {
    var pagelet = this
      , result = this._queue.map(function flatten(fragment) {
          if (!fragment.name || !fragment.view) return '';
          return fragment.view;
        });

    try {
      result = this._contentType === contentTypes.json
        ? JSON.stringify(result.shift())
        : result.join('');
    } catch (error) {
      this.emit('done', error);
      return this.debug('Captured error while stringifying JSON data %s', error);
    }

    this._queue.length = 0;
    return result;
  }
function join ( ) { var pagelet = this , result = this . _queue . map ( function flatten ( fragment ) { if ( ! fragment . name || ! fragment . view ) return '' ; return fragment . view ; } ) ; try { result = this . _contentType === contentTypes . json ? JSON . stringify ( result . shift ( ) ) : result . join ( '' ) ; } catch ( error ) { this . emit ( 'done' , error ) ; return this . debug ( 'Captured error while stringifying JSON data %s' , error ) ; } this . _queue . length = 0 ; return result ; }
Joins all the data fragments in the queue.

@return {Mixed} Object by pagelet name or HTML string
@api private
Joins all the data fragments in the queue .