title: Stop the execution of an Observable chain based on a condition
body: <p>In an Angular application, I have this Observable chain in my component : </p>
  
  <pre><code>@Component({
  selector: 'app-search',
  templateUrl: './search.component.html',
  styleUrls: ['./search.component.css']
  })
  export class SearchComponent implements OnInit {
  </code></pre>
  
  <p><strong>search.component.ts</strong></p>
  
  <pre><code>results: any[] = [];
  queryField: FormControl = new FormControl();
  constructor(private _apiService: ApiService) { }
  
  ngOnInit() {
  
  this.queryField.valueChanges
  .debounceTime(200)
  .distinctUntilChanged()
  .switchMap((query) =&gt; this._apiService.search(query)) // was subscribe
  .subscribe(result =&gt; {  this.results = result.items; console.log(result); });
  </code></pre>
  
  <p>}
  }</p>
  
  <p><strong>seach.ccomponent.html</strong></p>
  
  <pre><code>&lt;input [formControl]='queryField' type="text" id="keyword" autocomplete="off" placeholder="start typing..."/&gt;
  </code></pre>
  
  <p>What I would like to do is to cancel the execution of the rest of the Observables chain and don't go to the switchMap operator (in order to don't execute the request) if the value emitted du the formControl is null.</p>