The function to be throttled.
The number of milliseconds to throttle invocations to.
Optionaloptions: { leading?: boolean; trailing?: boolean }Options object.
Optionalleading?: booleanIf true the func will be executed on the leading edge of the timeout.
Optionaltrailing?: booleanIf true the func will be executed on the trailing edge of the timeout.
Creates a throttled function that will execute
funcat most once pertimeInMsinterval.The returned function exposes
.cancel()to discard the pending trailing call.