1. let fn = (x) => {
    2. console.log("start " + x);
    3. };
    4. let timer = null;
    5. function debounce(time, fn, ...argus) {
    6. if (timer) {
    7. window.clearTimeout(timer);
    8. }
    9. timer = setTimeout(() => {
    10. fn.apply(null, argus);
    11. timer = false;
    12. }, time);
    13. }