How to unsubscribe Observer? : <p>There is observer:</p>

<pre><code>export class ListenerService {

    private action: Subject&lt;IActionData&gt; = new Subject();

    apply(data?: IActionData) {
        this.action.next(data);
    }

    changes(): Observable&lt;any&gt; {
        return this.action.asObservable();
    }
}
</code></pre>

<p><strong>Using is:</strong></p>

<pre><code>this.sub = this.listener.changes();
this.sub.subscribe((res: IActionData) =&gt; {});
</code></pre>

<p>In destroy component I tried to unset <code>this.sub</code>:</p>

<pre><code> ngOnDestroy() {
    if (this.sub) {
      console.log(this.sub);
      this.sub.unsubsribe();
    }
  }
</code></pre>

<p>It says:</p>

<blockquote>
  <p>ERROR TypeError: this.sub.unsubsribe is not a function
      at VersionsAddressComponent.ngOnDestroy</p>
</blockquote>
