title: Angular conditional polling with time interval
body: <p>I have a polling scenario like below where I'm polling every 1 secs to a rest API and waits for a result</p>
  <pre><code>interval(1000)
        .pipe(
          startWith(0),
          switchMap(() =&gt; this.itemService.getItems(shopId))
        )
        .subscribe(response =&gt; {
          console.log(response);
          
          if(response &amp;&amp; response.status = false) {
              // stop polling
          }
          
          );
        });
  </code></pre>
  <p>polling part is working without an issue. The issue is I want the polling to stop when I get a response and its status is false. How to change this code to conditionally stop polling?</p>