makePromises(mainPromise) {
    var promises = [mainPromise];
    if (this.state.data.tagList.length === 0) {
      promises.push(this.state.data.tagList.get());
    }
    if (this.state.data.categoryTree.length === 0) {
      promises.push(this.state.data.categoryTree.get());
    }
    return Promise.all(promises);
  }
/* makePromises(mainRequestPromise)
   *
   * Merge the request promise with other promises we need to make to complete
   * the page. In this case, only on the first request, we will need the tag
   * list and category tree.
   *
   * * This technique is not manditory.
   * * It means all data can be in the core of the application to be shared
   *   with (for example) sidebar widgets.
   * * It means we only render once per request.
   *
   * React has a problem in that it encourages loops within loops and worse:
   * it encourages dynamic function definitions inside nested loops. True, it
   * is supposed to limit unnecessary rendering, but mistakes happen. If we
   * reduce the number of renders, the application will be faster.
   *
   */
makePromises(mainRequestPromise)
Merge the request promise with other promises we need to make to complete
the page. In this case, only on the first request, we will need the tag
list and category tree.

This technique is not manditory.
It means all data can be in the core of the application to be shared
with (for example) sidebar widgets.
It means we only render once per request.

React has a problem in that it encourages loops within loops and worse:
it encourages dynamic function definitions inside nested loops. True, it
is supposed to limit unnecessary rendering, but mistakes happen. If we
reduce the number of renders, the application will be faster.
makePromises ( mainRequestPromise ) Merge the request promise with other promises we need to make to complete the page . In this case only on the first request we will need the tag list and category tree . This technique is not manditory . It means all data can be in the core of the application to be shared with ( for example ) sidebar widgets . It means we only render once per request . React has a problem in that it encourages loops within loops and worse : it encourages dynamic function definitions inside nested loops . True it is supposed to limit unnecessary rendering but mistakes happen . If we reduce the number of renders the application will be faster .
makePromises(mainPromise) {
    var promises = [mainPromise];
    if (this.state.data.tagList.length === 0) {
      promises.push(this.state.data.tagList.get());
    }
    if (this.state.data.categoryTree.length === 0) {
      promises.push(this.state.data.categoryTree.get());
    }
    return Promise.all(promises);
  }
makePromises ( mainPromise ) { var promises = [ mainPromise ] ; if ( this . state . data . tagList . length === 0 ) { promises . push ( this . state . data . tagList . get ( ) ) ; } if ( this . state . data . categoryTree . length === 0 ) { promises . push ( this . state . data . categoryTree . get ( ) ) ; } return Promise . all ( promises ) ; }
makePromises(mainRequestPromise)
 Merge the request promise with other promises we need to make to complete
 the page.
makePromises ( mainRequestPromise ) Merge the request promise with other promises we need to make to complete the page .