title: Angular Promise - debounceTime behavior
body: <p>I'm using angular 7 and I've the following (working) code.</p>
  
  <pre><code>    import { Http } from '@angular/http';
  
  
      public httpService: Http;
      (....)
  
      public callAction(): Promise&lt;void&gt; {
          let r = this.httpService.post(url, panelData);
  
          return r.toPromise().then((response: { json: () =&gt; any; }) =&gt; {
              if (response.json()) {
                  this.processResponse(panel, response.json());
              }
          }).catch((reason: any) =&gt; {
              throw reason;
          });
      }
  </code></pre>
  
  <p>The method <em>this.httpService.post</em> returns an <em>Observable&lt; Response ></em>.</p>
  
  <p>I'm trying to avoid multiple server calls and for that I'm trying to use the <a href="https://www.learnrxjs.io/operators/filtering/debouncetime.html" rel="nofollow noreferrer">debounce behavior</a>.</p>
  
  <p>I added the debounceTime on my Observable but it doesn't work when the <strong>Promise</strong> is called.</p>
  
  <pre><code>let r = this.httpService.post(url, panelData).debounceTime(5000);
  return r.toPromise().then()
  </code></pre>
  
  <p>I know that I'm not subscribing the Observable but when I call the toPromise() should this behavior be "imported" to the promise?</p>
  
  <p>PS- I also try with a pipe</p>
  
  <pre><code>let r = this.httpService.post(url, panelData).pipe(debounceTime(5000));
  </code></pre>