title: What is the difference between throttleTime vs debounceTime in RxJS and when to choose which?
body: <p>I'm trying to understand <code>throttleTime</code> vs <code>debounceTime</code> and which one is to be used when?</p>
  <p>I have an upvote button that makes an API request to the backend (which counts the votes). User can submit button multiple times, but I'd like to limit the times per second button can be pressed.</p>
  <p>I know <code>throttleTime</code> and <code>debounceTime</code> operators can do that, but which one should I choose?</p>
  <pre class="lang-js prettyprint-override"><code>const upvoteClicks = fromEvent(this.el.nativeElement, 'click')
     .pipe(debounceTime(500))
     .subscribe(() =&gt; this.myService.postUpvote(this.postId));
  </code></pre>