title: Angular observables - Do I need unsubscribe if no subscription?
body: <p>I am using latest angular 8 and am new to the concept of observables. Question I have if I am directly calling an observable and not apply it to a subscription variable, do I still need to unsubscribe. Below are the scenarios I would like to know if I need to unsubscribe on?
  Many thanks in advance</p>
  
  <p>Scenario 1 - Calling a httpService from a component:</p>
  
  <pre><code>Service - httpService
  
       getContactsHttp(){
           let headers: any = new HttpHeaders(this.authService.getHeadersClient());
           return this.httpClient.get('/contacts', {headers: headers})
            .pipe(timeout(this.authService.getTimeoutLimit('normal')));
          }
  
  Component - Calling getContactsHttp and sorting response
  
  getContacts() {
   this.httpService.getContactsHttp().subscribe((data:any[])=&gt;{
    this.records = this.sortData(data)
   })
  }
  </code></pre>
  
  <p>Scenario 2 - on an observable susbcribed in a component</p>
  
  <pre><code>contacts$: new Subject&lt;any[]&gt;;
  
  ngOnInit() {
    this.getContacts();
    this.contacts$.subscribe((data:any[])=&gt;{
      this.records = this.sortData(data);
    })
  }
  
  getContacts() {
      this.httpService.getContactsHttp().subscribe((data:ContactSearch[])=&gt;{      
        this.contacts$.next(data);
      })
    }
  </code></pre>
  
  <p>Service - httpService</p>
  
  <pre><code>     getContactsHttp(){
           let headers: any = new HttpHeaders(this.authService.getHeadersClient());
           return this.httpClient.get('/contacts', {headers: headers})
            .pipe(timeout(this.authService.getTimeoutLimit('normal')));
          }
  </code></pre>