I'm trying to understand throttleTime vs debounceTime and which one is to be used when?
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.
I know throttleTime and debounceTime operators can do that, but which one should I choose?
const upvoteClicks = fromEvent(this.el.nativeElement, 'click')
.pipe(debounceTime(500))
.subscribe(() => this.myService.postUpvote(this.postId));

