index.js
/**
   * Fill subscribed targets
   *
   * @memberOf SubscribeForData
   * @returns {Promise}
   */
Fill subscribed targets
@memberOf SubscribeForData
@returns {Promise}
Fill subscribed targets @memberOf SubscribeForData @returns { Promise }
async function fillSubscriptions() {
    if (isFilling) await new Promise(resolve => bus.once('released', resolve));
    isFilling = true;
    const promises = awaiting
      .map(({ source, targetField, options: {
          extractKey, sourceField, getStream, isMultiple, useEachAsync, getDataHandler, parallel, assignData
        }, targets, condition }) => useEachAsync ?
        getStream(source, condition).eachAsync(getDataHandler({ targets, extractKey, isMultiple, targetField, sourceField, assignData }),
          { parallel }) :
        new Promise((resolve, reject) => getStream(source, condition)
          .on('data', getDataHandler({ targets, extractKey, isMultiple, targetField, sourceField, assignData }))
          .on('error', reject)
          .on('end', resolve)));
    awaiting.splice(0, awaiting.length);
    isFilling = false;
    bus.emit('released');
    return Promise.all(promises);
  }
async function fillSubscriptions ( ) { if ( isFilling ) await new Promise ( resolve => bus . once ( 'released' , resolve ) ) ; isFilling = true ; const promises = awaiting . map ( ( { source , targetField , options : { extractKey , sourceField , getStream , isMultiple , useEachAsync , getDataHandler , parallel , assignData } , targets , condition } ) => useEachAsync ? getStream ( source , condition ) . eachAsync ( getDataHandler ( { targets , extractKey , isMultiple , targetField , sourceField , assignData } ) , { parallel } ) : new Promise ( ( resolve , reject ) => getStream ( source , condition ) . on ( 'data' , getDataHandler ( { targets , extractKey , isMultiple , targetField , sourceField , assignData } ) ) . on ( 'error' , reject ) . on ( 'end' , resolve ) ) ) ; awaiting . splice ( 0 , awaiting . length ) ; isFilling = false ; bus . emit ( 'released' ) ; return Promise . all ( promises ) ; }
Fill subscribed targets
 @memberOf SubscribeForData
 @returns {Promise}
Fill subscribed targets @memberOf SubscribeForData @returns { Promise }