export function throttle(f, wait = 200) {
    let throttled = false;
    return function () {
        if (throttled)
            return;
        const context = this;
        const args = arguments;
        f.apply(context, args);
        throttled = true;
        setTimeout(() => (throttled = false), wait);
    };
}
