block by dlwjiang faefb2b1feaf3d2b6787

ThrottleDebounce

Full Screen

Understanding Throttle and Debounce Through Analogy:

###Throttle:

A lazy person who ignores your commands until he is rested.

###Debounce:

A cranky clerk condescending waiting for you to stop talking before doing anything.

####Note:

For throttle’s demonstration, the task animation time is set to the same as the resting time. In most use cases, the task itself is relatively instant so there would be more than 1 dot moving around. Throttle then adjusts the minimum distance between each dot, ‘throttling’ the firehose of tasks to an acceptable level.

For debounce, the red timer is usually very short. The main purpose is to group multiple actions into 1 action such as accidentally double clicking a save button.

Both actions can be hacked to do the work of the other though it’s best to keep the proper model in mind. Throttle ‘throttles’ the rate of actions while debounce ‘throttles’ noise so that random noise is not perceived as multiple actions.

index.html