title: Nested subscribe infinity loop - Angular / RxJS
body: <p>I'm doing a nested subscribe that I know it's not the perfect way.
  I have something like this : </p>
  
  <pre><code> this.route.params.subscribe((params) =&gt; {            
          this.order$
              .getMailCommande(this.id)
              .subscribe((datas) =&gt; {
                  var Object = localStorage.getItem('dataCommand');
                  var test = JSON.parse(retrievedObject);
                  this.over = test.over;
                  while (this.over == false) {
                      this.order$
                          .getMoreInfo(this.id, this.type, this.nbr)
                          .subscribe((datas2) =&gt; {
                              var array = datas2.MoreInfo;
                              var Object2 = localStorage.getItem('dataCommand');
                              var test2 = JSON.parse(Object2);
                              test2.ListeInfo.push(array);
                              this.over = true;
                          });
                  }
  </code></pre>
  
  <p>Since I added the loop  I got an infinity loop, i'm looking for changing this code with the switchmap or operators from RxJS but I haven't yet succeeded.</p>
  
  <p>Any ideas of my infinity loop and how to keep the same logic ?</p>
  
  <p>Thanks in advance</p>