Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 1.07 KB

throttleTime.md

File metadata and controls

28 lines (21 loc) · 1.07 KB
id mainCompare lesson video learnBackAbout learnAbout compare title layout class preview_image preview_image_alt
throttleTime
debounceTime
13
246763833
debounceTime
reduce
debounceTime
throttleTime
Rate-limiting in RxJS - debounceTime vs throttleTime
default
post
throttleTime/content_preview.jpg
The "throttleTime" operator

debounceTime vs throttleTime in RxJS

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.

See also

{:.w300}
The JavaScript pipeline operator proposal

{:.w450.shadow-lg}
Launchpad for RxJS