export default function debounce(fn, delay) {
    let handle = null

    return function () {
        if (handle) {
            handle = clearTimeout(handle)
        }

        handle = setTimeout(() => {
            fn(...arguments)
        }, delay)
    }
}