Limit how frequently a function can be invoked over time.
Usage:
import { throttle } from "mazey";const foo = throttle(() => { console.log("The function will be invoked at most once per every wait 1000 milliseconds.");}, 1000, { leading: true }); Copy
import { throttle } from "mazey";const foo = throttle(() => { console.log("The function will be invoked at most once per every wait 1000 milliseconds.");}, 1000, { leading: true });
Reference: Lodash
Function to throttle.
Minimum interval between invocations, in milliseconds.
Optional
Whether to invoke on the leading edge.
Whether to invoke on the trailing edge.
The throttled function.
Limit how frequently a function can be invoked over time.
Usage:
Reference: Lodash