title: How to stop rxjs timer
body: <p>I have the following timer:</p>
  
  <pre><code>setCountDown() {
          let counter = 5;
          let tick = 1000;
          this.countDown = timer(0, tick)
          .pipe(
            take(counter),
            map(() =&gt; --counter),
            finalize(() =&gt; {
              if (this.currentQuestionNumber &lt; this.questionsToAsk)
                this.showNextQuestion();
              else {
                this.endQuiz();
              }
  
            })
          );
        }
  </code></pre>
  
  <p>How can I stop the timer? E.g. when a user clicks on a button...</p>