title: Nesting promises for a parallel effect?
body: <p>I've had to nest a promise within a promise, is this okay, or considered bad practise?</p>
  
  <ol>
  <li>I've a class which has a method, <code>fetchArticles</code>, <code>fetchImages</code>, and <code>main</code>.
  
  <ul>
  <li>The <code>main</code> is the one which calls <code>fetchArticles</code> + <code>fetchImages</code> </li>
  <li><code>fetchArticles</code> runs a function from another file which returns a promise, but I'm also returning a promise on the <code>fetchArticles</code> class method itself, so when it's fetched the articles, it will go ahead and fetch the images.</li>
  <li><code>fetchImages</code> method is not promised but calls a promised function from another file.</li>
  </ul></li>
  </ol>
  
  <p>I'm unsure if this is the best way to achieve a parralel effect?</p>
  
  <pre><code>main () {
      // Call the promised fetchArticles class method
      this.fetchArticles()
      .then ( () =&gt; this.fetchImages( () =&gt; {
           this.res.json(this.articles.data);
      }));
  }
  
  
  fetchArticles () {
      return new Promise ((fullfil, rej) =&gt; {
        // Calling a promised function which simply returns an array of articles
        fetchArticles (this.parametersForApiCall)
         .then ( (data) =&gt; {
          this.articles.data = data;
          this.articles.imageIds = [1,5,2,8,99,1000,22,44,55,120,241]; // Extract image IDS and save to class this
          fullfil();
        })
        .catch ( (err) =&gt; {
          console.log ("Something went wrong with api call", err);
          res.json({error: "Something went wrong", code: 1011});
          reject();
        });
      });
    }
  
  fetchImages (cb) {
        // Calling a promised function which simply returns an array of images
      fetchImages (this.imageIds).then( (imgs) =&gt; {
        this.images = imgs;
        cb (); // Temp callback method
      }).catch ( (err) =&gt; {
        console.log (err, "error finding images in then")
      })
    }
  }
  </code></pre>
  
  <p>Should I use something like async parallel? Note I've added a <code>callback</code> in the <code>fetchImages</code> method temporarily until I find a good solution for chaining promises.</p>