UNPKG

tsc-watch

Version:

The TypeScript compiler with onSuccess command

11 lines (10 loc) 294 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.debounce = debounce; function debounce(fn, delay = 300) { let timer; return (...args) => { timer && clearTimeout(timer); timer = setTimeout(() => fn.apply(this, args), delay); }; }