id | mainCompare | lesson | video | learnBackAbout | learnAbout | compare | title | layout | class | preview_image | preview_image_alt | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
throttleTime |
debounceTime |
13 |
246763833 |
debounceTime |
reduce |
|
Rate-limiting in RxJS - debounceTime vs throttleTime |
default |
post |
throttleTime/content_preview.jpg |
The "throttleTime" operator |
If your stream is created from key presses or mouse movements, you'll likely deal with bursts of events. But you can't react to every single event, as it would overload the CPU or flood the servers with too many requests.
❚ debounceTime
rate-limits events, based on an "emission silence" window of time. ❚ throttleTime
doesn't delay events.
They both accept a time period argument, such as 500
milliseconds.