Maria Korneeva
Oct 31, 2020

Hi Andres,

thanks for your comment. I think, technically speaking it is a valid solution. Yet as far es I understand, throtthling has a slightly different meaning:

  • debounce: Grouping a sudden burst of events (like keystrokes) into a single one.
  • throttle: Guaranteeing a constant flow of executions every X milliseconds. Like checking every 200ms your scroll position to trigger a CSS animation.

With throttleTime, when first time you click the button, 0 would be printed and then even if you click the button again multiple times, 1 would be printed only after 1 second. But I guess, in my scenario I don’t want this second click, if the user just keeps clicking on the delete-button.

Here is a nice resource on buttons, throttling and debouncing that I found while researching throttleTime: https://namitamalik.github.io/throttleTime-vs-debounceTime-in-RxJS/

Maria Korneeva
Maria Korneeva

Written by Maria Korneeva

Learning tech hacks by sharing them with you— that is what drives me. #learningbysharing

No responses yet