debounceTime
accepts
1 input stream,
time period number
time period of silence measured restarts from zerotime period of silence and then emits the latest value of the input streamreturns a new stream of debounced values
throttleTime
accepts
1 input stream,
time period number
time periodreturns a new stream of throttled values
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
Freelance Developer Advocate. Motion graphics with code. JavaScript and Elm. cedricsoulas.com
Receive my latest news, product updates and programming visualizations. You can unsubscribe at any time.