Create a function that will only execute once per wait
periods.
Create a function that will only execute once per wait
periods
from last execution when called repeatedly. Useful for preventing excessive
calculations in rapidly firing events, such as window.resize, node.mousemove
and so on.
Parameter | Type | Description |
---|---|---|
cb | Function | The callback to fire. |
wait | Integer | time to delay before allowing cb to call again. |