mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-05-15 22:05:43 +02:00
9 lines
260 B
TypeScript
9 lines
260 B
TypeScript
export const debounceCallback = () => {
|
|
let timeout: NodeJS.Timeout;
|
|
|
|
return (fnc: any, time: number) => {
|
|
const functionCall = (...args: any[]) => fnc.apply(args);
|
|
clearTimeout(timeout);
|
|
timeout = setTimeout(functionCall, time) as any;
|
|
};
|
|
}; |