/**
 * @since 6.0.0
 */ export function debounce(fn, duration) {
    let timeout;
    const debounced = (...args)=>{
        clearTimeout(timeout);
        timeout = setTimeout(()=>{
            fn(...args);
        }, duration);
    };
    debounced.cancel = ()=>{
        clearTimeout(timeout);
    };
    return debounced;
}

//# sourceMappingURL=debounce.js.map