export const thorttle = (fn, delay = 3000) => {
    // 接收定时器的地址
    let timer = null;
    return function () {
        let _this = this;
        let args = arguments;
        // 如果等到了delay才能执行并清空定时器
        if (!timer) {
            timer = setTimeout(function () {
                timer = null;
                fn.apply(_this, args);
            }, delay)
        }
    }
}