static loadNextVisibleCollection(snapshotRoot) {
    if (_isLoading) {
      return Promise.reject(
        new Error('Cannot load a new collection while another one is loading')
      );
    }
    let nextCollectionName = Properties.groupOrder.find(
        c => !_loadedCollections.includes(c)
      ),
      nextCollection = window.ArticleCollections.getCollections().find(
        c => c.title === nextCollectionName
      );

    if (!nextCollection) {
      return Promise.reject(new Error('Cannot find a new collection to load'));
    }

    let cachedArticles = _loadedCollections[nextCollectionName];
    if (cachedArticles) {
      _articles = _articles.concat(cachedArticles);
      Promise.resolve(cachedArticles);
    }

    _isLoading = true;

    return Ajax.get(`${snapshotRoot}/${nextCollection.url}`)
      .catch(e => e)
      .then(articles => {
        let loadedArticles = [];

        if (Array.isArray(articles) && articles.length) {
          let filters = _collectionFilters[nextCollection.name];
          if (Array.isArray(filters)) {
            filters.forEach(
              f => (articles = f.filter.doFilter(articles, f.options))
            );
          }

          loadedArticles = articles.map(a => {
            a.article_collection_title = nextCollection.title; // change title to display title
            return new Article(a);
          });
        }

        _loadedCollections[nextCollectionName] = loadedArticles;

        loadedArticles = new _sortingStrategy([loadedArticles]).sort(
          _sortingStrategyOptions
        );

        _articles = _articles.concat(loadedArticles);
        _loadedCollections.push(nextCollectionName);
        _isLoading = false;
        return Promise.resolve(loadedArticles);
      });
  }
/**
   * If using groups, and Properties.groupOrder is set to the order you'll receive collections,
   * this will get the next collect in the order. If there are no more collections it will return an error.
   *
   * @param {string} snapshotRoot  - set to the siteURL, ex: '/zumobi/3-0/1518637341'
   * @returns {Promise.<ArticleCollection>} - Promise that resolves to the Article collection that's next
   */
If using groups, and Properties.groupOrder is set to the order you'll receive collections,
this will get the next collect in the order. If there are no more collections it will return an error.

@param {string} snapshotRoot  - set to the siteURL, ex: '/zumobi/3-0/1518637341'
@returns {Promise.} - Promise that resolves to the Article collection that's next
If using groups and Properties . groupOrder is set to the order you ' ll receive collections this will get the next collect in the order . If there are no more collections it will return an error . @param { string } snapshotRoot - set to the siteURL ex : ' / zumobi / 3 - 0 / 1518637341 ' @returns { Promise . } - Promise that resolves to the Article collection that ' s next
static loadNextVisibleCollection(snapshotRoot) {
    if (_isLoading) {
      return Promise.reject(
        new Error('Cannot load a new collection while another one is loading')
      );
    }
    let nextCollectionName = Properties.groupOrder.find(
        c => !_loadedCollections.includes(c)
      ),
      nextCollection = window.ArticleCollections.getCollections().find(
        c => c.title === nextCollectionName
      );
    if (!nextCollection) {
      return Promise.reject(new Error('Cannot find a new collection to load'));
    }
    let cachedArticles = _loadedCollections[nextCollectionName];
    if (cachedArticles) {
      _articles = _articles.concat(cachedArticles);
      Promise.resolve(cachedArticles);
    }
    _isLoading = true;
    return Ajax.get(`${snapshotRoot}/${nextCollection.url}`)
      .catch(e => e)
      .then(articles => {
        let loadedArticles = [];
        if (Array.isArray(articles) && articles.length) {
          let filters = _collectionFilters[nextCollection.name];
          if (Array.isArray(filters)) {
            filters.forEach(
              f => (articles = f.filter.doFilter(articles, f.options))
            );
          }
          loadedArticles = articles.map(a => {
            a.article_collection_title = nextCollection.title; 
            return new Article(a);
          });
        }
        _loadedCollections[nextCollectionName] = loadedArticles;
        loadedArticles = new _sortingStrategy([loadedArticles]).sort(
          _sortingStrategyOptions
        );
        _articles = _articles.concat(loadedArticles);
        _loadedCollections.push(nextCollectionName);
        _isLoading = false;
        return Promise.resolve(loadedArticles);
      });
  }
static loadNextVisibleCollection ( snapshotRoot ) { if ( _isLoading ) { return Promise . reject ( new Error ( 'Cannot load a new collection while another one is loading' ) ) ; } let nextCollectionName = Properties . groupOrder . find ( c => ! _loadedCollections . includes ( c ) ) , nextCollection = window . ArticleCollections . getCollections ( ) . find ( c => c . title === nextCollectionName ) ; if ( ! nextCollection ) { return Promise . reject ( new Error ( 'Cannot find a new collection to load' ) ) ; } let cachedArticles = _loadedCollections [ nextCollectionName ] ; if ( cachedArticles ) { _articles = _articles . concat ( cachedArticles ) ; Promise . resolve ( cachedArticles ) ; } _isLoading = true ; return Ajax . get ( ` ${ snapshotRoot } ${ nextCollection . url } ` ) . catch ( e => e ) . then ( articles => { let loadedArticles = [ ] ; if ( Array . isArray ( articles ) && articles . length ) { let filters = _collectionFilters [ nextCollection . name ] ; if ( Array . isArray ( filters ) ) { filters . forEach ( f => ( articles = f . filter . doFilter ( articles , f . options ) ) ) ; } loadedArticles = articles . map ( a => { a . article_collection_title = nextCollection . title ; return new Article ( a ) ; } ) ; } _loadedCollections [ nextCollectionName ] = loadedArticles ; loadedArticles = new _sortingStrategy ( [ loadedArticles ] ) . sort ( _sortingStrategyOptions ) ; _articles = _articles . concat ( loadedArticles ) ; _loadedCollections . push ( nextCollectionName ) ; _isLoading = false ; return Promise . resolve ( loadedArticles ) ; } ) ; }
If using groups, and Properties.groupOrder is set to the order you'll receive collections,
 this will get the next collect in the order.
If using groups and Properties . groupOrder is set to the order you ' ll receive collections this will get the next collect in the order .
// change title to display title