hisptz/function-analytics

View on GitHub
src/utilities/multi-fetcher.js

Summary

Maintainability
A
0 mins
Test Coverage
import { Runner } from './runner';
import { Fetcher } from './fetcher';

/**
 * Represents the multiple fetcher process
 *@extends Fetcher
 */
export class MultiFetcher extends Fetcher {

  /**
   * Creates a fethcer
   * @constructor
   */
  constructor(fetchers) {
    super();
    this._fetchers = fetchers;
  }

  /**
   * Gets the Fetchers
   * @returns {array} fetchers - Array of Fetchers
   */
  get fetchers() {
    return this._fetchers;
  }

  /**
   * Gets the executed Promise
   * @returns {ProgressPromise} progressPromise - Promise which alerts progresss
   */
  get() {
    return (new Runner()).getAllResults(this);
  }
}