index.js
function addChildren(newData) {
    var promises = [];
    newData.forEach(function (child) {
      promises.push(add(child));
    });

    return Promise.all(promises).then(emitValue);
  }
function addChildren(newData) {
    var promises = [];
    newData.forEach(function (child) {
      promises.push(add(child));
    });

    return Promise.all(promises).then(emitValue);
  }
function addChildren ( newData ) { var promises = [ ] ; newData . forEach ( function ( child ) { promises . push ( add ( child ) ) ; } ) ; return Promise . all ( promises ) . then ( emitValue ) ; }
add children to data buffer, and emit value

@return {Promise}
add children to data buffer and emit value