throttle

Generates a function that invokes the given function func at most once per every wait milliseconds.
The throttled function always returns the result of the last func invocation.

This function can be used as a decorator with decThrottle.

Example