sort(options) {
    this._collections.forEach(collection => {
      collection.forEach(ar => this._addArticle(ar));
    });

    if (options && options.orderBy === 'desc') {
      this._articles = this._articles.sort(
        (a, b) =>
          a.article_published_at < b.article_published_at
            ? 1
            : a.article_published_at > b.article_published_at
              ? -1
              : 0
      );
    } else {
      this._articles = this._articles.sort(
        (a, b) =>
          a.article_published_at > b.article_published_at
            ? 1
            : a.article_published_at < b.article_published_at
              ? -1
              : 0
      );
    }

    return this._articles;
  }
/**
   * Performs a sort over all of the article collections.
   *
   * @param {Object} options  - Options has passed to the sort method
   * @returns {Array}         - Array of all articles in sorted order
   */
Performs a sort over all of the article collections.
@param {Object} options  - Options has passed to the sort method
@returns {Array}         - Array of all articles in sorted order
Performs a sort over all of the article collections . @param { Object } options - Options has passed to the sort method @returns { Array } - Array of all articles in sorted order
sort(options) {
    this._collections.forEach(collection => {
      collection.forEach(ar => this._addArticle(ar));
    });
    if (options && options.orderBy === 'desc') {
      this._articles = this._articles.sort(
        (a, b) =>
          a.article_published_at < b.article_published_at
            ? 1
            : a.article_published_at > b.article_published_at
              ? -1
              : 0
      );
    } else {
      this._articles = this._articles.sort(
        (a, b) =>
          a.article_published_at > b.article_published_at
            ? 1
            : a.article_published_at < b.article_published_at
              ? -1
              : 0
      );
    }
    return this._articles;
  }
sort ( options ) { this . _collections . forEach ( collection => { collection . forEach ( ar => this . _addArticle ( ar ) ) ; } ) ; if ( options && options . orderBy === 'desc' ) { this . _articles = this . _articles . sort ( ( a , b ) => a . article_published_at < b . article_published_at ? 1 : a . article_published_at > b . article_published_at ? - 1 : 0 ) ; } else { this . _articles = this . _articles . sort ( ( a , b ) => a . article_published_at > b . article_published_at ? 1 : a . article_published_at < b . article_published_at ? - 1 : 0 ) ; } return this . _articles ; }
Performs a sort over all of the article collections.
Performs a sort over all of the article collections .