title: How do I stop Observable.Timer() or Observable.Interval() automatically after certain period of time
body: <pre><code>public function(id: number) {
      this.periodicCheckTimer = Observable.timer(10000, 5000).subscribe(
          () =&gt; {
            let model = this.find(id);
            if (model['isActivated']) {
              this.periodicCheckTimer.unsubscribe();
            }
          });
    }
  </code></pre>
  
  <p>I want to stop the timer automatically after 5 mins if the condition <strong>if(model['isActivated'])</strong> is not satisfied. However if the condition satisfies I can stop it manually. Not sure if the manual stop is still correct in this case.</p>
  
  <p>Any suggestions with other timer functions are also appreciated.</p>