Files
AFFiNE-Mirror/packages/app/src/utils/tools.ts
T
MingLiang Wang ba9d94e3f5 feat: leave ui
2022-12-23 12:07:53 +08:00

9 lines
219 B
TypeScript

export function debounce(fn: Function, timeout: number) {
let timeoutId: any;
return function (this: any) {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => fn.apply(this, arguments), timeout);
};
}