Logo

GitLab

Sign in

qiangmj / ebc-Mes

  • Back to Dashboard
  • Project
  • Activity
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • Snippets
  • ebc-Mes
  • src
  • components
  • Common
  • ReactDebounce
  • debounce.js
  • init
    198ee074
    qmj authored
    2025-08-14 10:32:07 +0800  
    Browse Code »
debounce.js 187 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11
export default function (func, ms) {
  let tid;
  return (...args) => {
    if (tid) {
      clearTimeout(tid);
    }
    tid = setTimeout(() => {
      func(...args);
    }, ms);
  };
}