title: Javascript rxjs - do something when last value emitted from observable
body: <p>Following situation: I make two async http calls. </p>
  
  <ul>
  <li>one for getting a list of names</li>
  <li>another for making something for each name in the list/array</li>
  </ul>
  
  <hr>
  
  <p>For the sake of simplicity: Lets imagine the first call returns me a list of names: 
  <code>['marta', 'edgar', 'david']</code>.
  And the second http call post the names in the database. 
  My implementation works fine for this operational requirement. It looks as follows:</p>
  
  <pre><code>public deployAllPartners(): void {
      this.isDeploying = true;
      this.getAllPartner().subscribe(shortname =&gt; this.adminService.deploySinglePartnerForTesting(shortname).subscribe());
  }
  
  private getAllPartner(): Observable&lt;string&gt; {
      return this.partnerService.getPartnersOverview()
          .flatMap((partnerList) =&gt; partnerList.partner) &lt;== returns an array
          .map((partner) =&gt; partner.shortname);
  }
  </code></pre>
  
  <h3>Problem:</h3>
  
  <p>Now what I want is that the boolean <code>isDeploying</code> is turning to false when the last name was deployed. Is there any <strong>RxJS Operator</strong> which is triggered when the last shortname is deployed? Maybe something like <code>finally()</code> or something along those line?. For completness: The boolean is there for a loading gif in the HTML and the gif is only showing up in the UI when <code>isDeploying=true</code> and of course is hidden when the value is false.</p>